PDA

View Full Version : Need script for seperating my form in stages



hoefie
03-19-2010, 12:15 PM
Hi guys,

First Question
I'm new here. I'm searching for a script that seperates my form in steps like (step1, step 2 etc) but step one needs to be fully validated before the user is able to continue.

Second Question
I found this script online. It shows my div by default but when the checkbox is clicked it hides the content. I'm trying to get it to do the opposite. You need to check it to show the div

<script type="text/javascript">

if( document.getElementById ) {
getElemById = function( id ) {
return document.getElementById( id );
}
} else if( document.all ) {
getElemById = function( id ) {
return document.all[ id ];
}
} else if( document.layers ) {
getElemById = function( id ) {
return document.layers[ id ];
}
}

function showhide( el, id) {
if ( el && el.style ) {
getElemById( id ).style.display = (el.checked)? 'none' : '';
}
}

</script>


<input
name="yesno" type="checkbox"
onclick="showhide(this, 'dn');" />
Small Room


<div id="dn" class="noshow">
<input name="textfield32" type="text" value="0" size="3" maxlength="2" />
Rooms that need furniture moved?<br />
<input name="textfield32" type="text" value="0" size="3" maxlength="2" />
Rooms that need an open area cleaned?<br />
<input name="textfield32" type="text" value="0" size="3" maxlength="2" />
Rooms that need heavy duty cleaning? <br />
</div>

Thx in advance :)

hoefie
03-19-2010, 01:55 PM
Don't bother, I already fixed it :P