williadn48
Programmer
I have the submit form working ok and I get the form back, but how do I force buttons to enable/disable and gray out fields? I need to write an initial starttime record to the db first and then continue processing or leave the form up on the screen for the user. The user will click stop eventually.
function DoFormChecks()
{
var selFA = document.frmTIMETRACKING.drpeFUNCAREA.value;
var selSF = document.frmTIMETRACKING.drpeSUBFUNC.value;
var inpBatches = document.frmTIMETRACKING.veBatches.value;
var inpComments = document.frmTIMETRACKING.veCOMMENTS.value;
//If Func Area = QC and...
if (selFA == 100)
{
//If Sub Func = Auditing...
if (selSF == 120)
{
//...then a number of batches must be entered.
if (inpBatches == "")
{
document.frmTIMETRACKING.btnStart.disabled = false;
alert("You must enter number of batches.");
return false;
}
}
}
else
//If Func Area = QC and...
if (selFA == 100)
{
//If Sub Func = System Errors or Other...
if (selSF == 121 || selSF == 8)
{
//...then comments must be entered.
if (inpComments == "")
{
document.frmTIMETRACKING.btnStart.disabled = false;
alert("You must enter comments.");
return false;
}
}
}
else
//If Func Area = Misc. and...
if (selFA == 102)
{
//If Sub Func = Meetings or Training or Projects...
if (selSF == 124 || selSF == 126 || selSF == 127)
{
//...then comments must be entered.
if (inpComments == "")
{document.frmTIMETRACKING.btnStart.disabled = false;
alert("You must enter comments.");
return false;
}
}
}
document.frmTIMETRACKING.btnStop.disabled = false;
document.frmTIMETRACKING.btnStart.disabled = true;
frmTIMETRACKING.hdnAction.value = 'Start';
frmTIMETRACKING.submit();
}
Why does the document.frmTIMETRACKING.btnStop.disabled = false; line not work above right before the .submit() action?
function DoFormChecks()
{
var selFA = document.frmTIMETRACKING.drpeFUNCAREA.value;
var selSF = document.frmTIMETRACKING.drpeSUBFUNC.value;
var inpBatches = document.frmTIMETRACKING.veBatches.value;
var inpComments = document.frmTIMETRACKING.veCOMMENTS.value;
//If Func Area = QC and...
if (selFA == 100)
{
//If Sub Func = Auditing...
if (selSF == 120)
{
//...then a number of batches must be entered.
if (inpBatches == "")
{
document.frmTIMETRACKING.btnStart.disabled = false;
alert("You must enter number of batches.");
return false;
}
}
}
else
//If Func Area = QC and...
if (selFA == 100)
{
//If Sub Func = System Errors or Other...
if (selSF == 121 || selSF == 8)
{
//...then comments must be entered.
if (inpComments == "")
{
document.frmTIMETRACKING.btnStart.disabled = false;
alert("You must enter comments.");
return false;
}
}
}
else
//If Func Area = Misc. and...
if (selFA == 102)
{
//If Sub Func = Meetings or Training or Projects...
if (selSF == 124 || selSF == 126 || selSF == 127)
{
//...then comments must be entered.
if (inpComments == "")
{document.frmTIMETRACKING.btnStart.disabled = false;
alert("You must enter comments.");
return false;
}
}
}
document.frmTIMETRACKING.btnStop.disabled = false;
document.frmTIMETRACKING.btnStart.disabled = true;
frmTIMETRACKING.hdnAction.value = 'Start';
frmTIMETRACKING.submit();
}
Why does the document.frmTIMETRACKING.btnStop.disabled = false; line not work above right before the .submit() action?