Quantcast
Channel: Serif Software Forums (Closed) - WebPlus
Viewing all articles
Browse latest Browse all 4745

WebPlus X6: disable form fields until previous field completed

$
0
0
Hi all,

I'm working on a form that requires two key elements completing. However, field 1 needs completing before field 2, so I've resorted to javascript to help out. The following works with wordpress, but for some reason not in WP? Any assistance would be welcomed.

Here's my code:

<script type="text/javascript">
function check() {
if(document.getElementById('NAME').value != "")
document.getElementById('address').disabled = false;
else
document.getElementById('address').disabled = true;
}
</script>


and the form elements for test:

<input type="text" name="NAME" maxlength="50" value="" style="position:absolute; left:150px; top:24px; width:180px;" class="mandatory" onblur="check()" />
<!--Postamble-->

<input type="text" name="address" maxlength="100" value="" style="position:absolute; left:150px; top:54px; width:180px;" class="mandatory" disabled="disabled" />


It appears to work, having tried it on a button, it reinstates button states (rollover, down) however, it will not submit! THe same appears true for a form field.

Regards,

Bob

Viewing all articles
Browse latest Browse all 4745

Trending Articles