Jump to content

changing the form depending on the radio button


verN

Recommended Posts

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.