|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
small error urgent help
Hi,
i have a 2 radio buttons named as Conf and a drop down named as ConfOD so if the user selects first radio button and then he selects the ConfOD i want to display an alert saying he cant do that so i have written this code which works fine if the user selects the radio button and something in drop down but then what i did was selected the radio button and changed the drop down Select a day... option but it still shows the alert can someone tell me whats wrong with it my radio buttons and drop downs are like these Code:
Radio buttons like these <input type="radio" id="AD" name="Conf" value="All/any day" /> <input type="radio" id="OD" name="Conf" value="One day only" /> drop down is like this <select id="ConfOD" name="ConfOD" size="1"> <option value="0">Select a day...</option> <option value="Monday">Monday</option> <option value="Tuesday">Tuesday</option> Code:
if((document.frm1.Conf[0].checked) || (document.frm1.ConfOD.selectedIndex > 0))
{
alert( alertMsg += "- You have done the wrong selection");
return false;
}
thanks, sammy |
|
#2
|
|||
|
|||
|
Hi,
i think i got this one working simple simple mistake the || should be replaced with && so the following lines works if((document.frm1.Conf[0].checked) && (document.frm1.ConfOD.selectedIndex > 0)) thanks, sammy |
|
#3
|
|||
|
|||
|
that's what I was going to say
![]() |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > small error urgent help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|