i've attached an image.. what i want is, the checkboxes/radio buttons below metro should not be enabled if metro is checked.. if metro is not clicked, the 1000 metres above mean sea level & Notified Hill area should be enabled only if Hillstation Resident is clicked.. any tips would be of much help to me.. thanks
mmmmm.... i guess you can use this coding: for metro checkbox add : name="metro"... And then start the PHP programming e.g: <?PHP $metro = $_POST['metro']; if(!isset($metro)){ ?> //and you add the other checkboxes or radio buttons <?; } else{?> //add some text or anything... <?;}?> PHP:
it didnt work here is the code for it, <form submit="step2.html"> <p>Name:<input type="text" name="name"> <p>Type: <input type="radio" name="male" value="true"> Male <input type="radio" name="female" value="false"> Female <input type="radio" name="child" value="false"> Child</input> <p>Living/Working in <input type="radio" name="metro" value="false">Metro</input> <p><input type="checkbox" name="hill" value="false"> Hillstation Resident: </input> <p><input type="radio" name="hill1000" value="false"> 1000 metres above mean sea level </input> <p><input type="radio" name="hillnotified" value="false"> Notified Hill area </input> <p><input type="checkbox" name="under" value="false"> Working in mines </input> <p><input type="checkbox" name="island" value="false"> Living in Island </input> <p><input type="submit" value="submit"> </form> Code (markup): even if not all, can anyone atleast tell how to make the following? if the radio button metro is enabled, everything below should be disabled..?
<form action="<? $_SERVER['PHP_SELF'];?>"> <p>Name:<input type="text" name="name"> <p>Type: <input type="radio" name="male" value="true"> Male <input type="radio" name="female" value="false"> Female <input type="radio" name="child" value="false"> Child <p>Living/Working in <input type="radio" name="metro" >Metro <? $metro = $_POST['metro']; if(!isset($metro)){ echo" <p><input type='checkbox' name='hill' value='false'> Hillstation Resident: </p> <p><input type='checkbox' name='under' > Working in mines </p> <p><input type='checkbox' name='island' > Living in Island </p> " ; $hill =$_POST['hill']; if(isset($hill)){echo " <p><input type='radio' name='hill1000' > 1000 metres above mean sea level </p> <p><input type='radio' name='hillnotified' > Notified Hill area </p>";} else{;} }?> <input type="submit" value="submit"> </form> this must work... but youll find the extra options after hitting the submit button... or else you will have to use some javascript... gd luck then... try this one and tell me if there are any mistakes as i haven't tested it...
here is what i came up with javascript... P.S: in the attached files.. P.S: Convert Both *.txt files to .js files... there's still one more file i can't upload ill post it directly here and u name it : jquery-1.2.6.pack and save it as .js file... too bad im not able to send the last file... so give me some email so i could send the file to...