Thank you for information.
My script changed. I can't week area.
I want to do the following rule:
If it has selected only star (*) or (-1), you can submit. Because week has disabled.
If it has selected day or days, week will enable, so you can't select (*) at the same time. If you select both of them and submit, javascript must alert. I want to do this but I can't. Can you help me?
<script type="text/javascript">
function Checkit(theform) {
var gorevadi = document.getElementById('gorev_adi').value;
if (gorevadi.length < 1){
error ='-Please enter a short name of the task\n\n';
}
if (gorevadi.length > 20){
error+="-Please do not exceed 20 characters\n\n";
}
if(theform.haftanin_gunu.value=="") {
error+="-If you want to use days of week, select day(s).\n-If you don't want to use days of week, select (*) and disable it.\n\n";
}
HERE CONTROL OF WEEK
var dosyaadi = document.getElementById('dosya_adi').value;
if (dosyaadi.length < 10){
error+="-Please enter file name of running local file or full URL\n\n";
}
if(error) {
alert('**THESE FIELDS ARE REQUIRED:**\n\n' + error);
error = "";
return false;
} else {
return true;
}
}
</script>
<form method="POST" onsubmit="return Checkit(this);">
<select size="8" name="haftanin_gunu[]" id="haftanin_gunu" multiple>
<option value="-1" selected="selected">*</option>
<option value="0">Sunday</option>
<option value="1">Monday</option>
<option value="2">Tuesday</option>
<option value="3">Wednesday</option>
<option value="4">Thursday</option>
<option value="5">Friday</option>
<option value="6">Saturday</option>
</select>
<p><input type="submit" value="Submit" name="B1">
<input type="reset" value="Reset" name="B2"></p>
</form>
TRUE http://awesomescreenshot.com/0561ox1e88
TRUE http://awesomescreenshot.com/01e1ox1g4b
FALSE http://awesomescreenshot.com/0de1ox1s9c
Thanks in advance