Hi,
I have this code for disabling a submit button on an ASP page however although I only call it from one element if any of the other elements are empty then i cannot enable the button.
Could someone tell me if it is possible to only action the code from one textfield Please
code to call function
Regards
Olly
I have this code for disabling a submit button on an ASP page however although I only call it from one element if any of the other elements are empty then i cannot enable the button.
Could someone tell me if it is possible to only action the code from one textfield Please
Code:
<script Language = "javascript">
// Start Insert Complaint ID Function
function MoveCID()
{
var myVar = document.frmBoard.cmbComplaint.value
document.frmBoard.txtCID.value = myVar;
}// End Insert Complaint ID Function
</script>
<script Language = "javascript">
function maybeDisableButton()
{
var dfe = document.frmBoard.elements;
var disableButton = false;
for(var i=0; i<dfe.length; i++)
{
if(dfe[i].value.length < 5)
{
disableButton = true;
break;
}//end if
else
{
disableButton = false;
}//end else
}//end for
document.frmBoard.Submit.disabled = disableButton;
}//end maybeDisableButton()
</script>
code to call function
Code:
onKeyUp = "maybeDisableButton()"
Regards
Olly