verN Posted February 26, 2007 Share Posted February 26, 2007 hi I want my form to be hidden and when the user clicks on one of the radio buttons a form appears and vice versa for the other radio button. However, i have tried doing this but the form appears on another page and the radio buttons disappear html> <body> <SCRIPT LANGUAGE="Javascript" type="text/javascript"> function showForm1() { //document.write('<input type="button" value="Submit" onclick="validateForm();" />'); document.write('<input name="roomNo" type="text" id="roomNo" value="MB146" size="10" />'); } function showForm2() { } </SCRIPT> <form method="post" action="speakers.php" name="form1"> <p>Seminar speaker:</p> <p><input name="radiobutton" type="radio" value="internal" onClick="showForm1();"> Internal speaker (KEG member) <input name="radiobutton" type="radio" onClick="showForm2()" value="external"> External speaker</p> </form> </body> </html> Link to comment https://forums.phpfreaks.com/topic/40222-changing-the-form-depending-on-the-radio-button/ Share on other sites More sharing options...
nloding Posted February 26, 2007 Share Posted February 26, 2007 Wrong forum, post in the Javascript forum. Link to comment https://forums.phpfreaks.com/topic/40222-changing-the-form-depending-on-the-radio-button/#findComment-194611 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.