Jump to content

Dynamic Forms


afrojojo

Recommended Posts

[quote author=weknowtheworld link=topic=121740.msg501121#msg501121 date=1168409781]
Use have to use txtboxname.style.display='hidden'  and txtboxname.style.display='visible' in javascript onclick() in radio button..
[/quote]
Thanks, but could you give me an example with all the code together?
Link to comment
https://forums.phpfreaks.com/topic/33553-dynamic-forms/#findComment-157143
Share on other sites

this should do what you need.
[code]
<script language="javascript">
function show_form(div_id){
document.getElementById('form1').style.display = "none";
document.getElementById('form2').style.display = "none";

document.getElementById(div_id).style.display = "";
}
</script>
<input type="radio" onclick="show_form('form1')" name="form" /> Form1<br />
<input type="radio" onclick="show_form('form2')" name="form" /> Form2<br />
<div id="form1" style="display:none;">
<input type="text" value="Form 1 fields" />
</div>

<div id="form2" style="display:none;">
<input type="text" value="Form 2 fields" />
</div>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/33553-dynamic-forms/#findComment-159543
Share on other sites

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.