quote:
Originally posted by:
dchard
I want to hide the drop down list after a client hit a button
beside it and replace the dropdown list by a text box. How will I
do that?
With great difficulty. I had a similar requirement once and
could not get it to work. Rather than turning it into a career, I
changed my approach. Instead of switching form elements, I switched
forms. Here are some bits of code.
<script language="javascript">
function showHide(checkBox) {
/*
controls what the user sees. If he checks the button, all the
mail stuff shows up and the 1st submit button disappears and gets
disabled. If he unchecks it, the reverse happens. Page loads with
button checked.
*/
if (checkBox.checked == true) {
document.getElementById('longform').style.visibility =
'visible';
document.getElementById('shortform').style.visibility =
'hidden';
document.theForm2.startmonth.focus();
document.theForm2.mail2.checked = true;
}
else {
document.getElementById('longform').style.visibility =
'hidden';
document.getElementById('shortform').style.visibility =
'visible';
document.theForm1.mail1.checked = false;
document.theForm1.startmonth.focus();
}
return true;
} // end of function
</script>
and then
<div id="longform" style="position:absolute; top:200">
<cfform name="theForm2">
etc
<div id="shortform" style="visibility:hidden;
position:absolute; top:200">
<cfform name="theForm1">
Maybe someone smarter than me can figure out how to do it by
switching elements in the same form.