earl wrote:
<input type=submit value="submit" name="submit">
Don't name a "submit" button "submit", you're overriding the js submit
method for the form (not that you should use it anyway).
Is it possible to hide both on form load and then from a drop down menu
choose which of the two to show ?
Certainly, see below. Note however that there are some accessibility
issues to consider, for instance users deprived from javascript, or
having non-supporting agents, might not be able to navigate your website.
<style type="text/css">
#f1, #f2 {visibility:hidden}
</style>
<div id="f1">
<form action="foo">
<!-- content goes here -->
<input type="submit" value="submit 1">
</form>
</div>
<div id="f2">
<form action="foo">
<!-- content goes here -->
<input type="submit" value="submit 2">
</form>
</div>
<form action="#">
<select onchange="f(this)">
<option value="">---</option>
<option value="f1">Show form 1</option>
<option value="f2">Show form 2</option>
</select>
</form>
<script type="text/javascript">
function f(sel){
var d=document, dv;
if(d.getElementById){
for(var ii=0; ii<sel.options.length; ii++){
dv=d.getElementById(sel.options[ii].value);
if(dv)
dv.style.visibility=sel.options[ii].selected?"visible":"hidden";
}
}
}
</script>
HTH
Yep.