williadn48
Programmer
This doesn't work:
...onclick='DoMultipleActions()'
function DoMultipleActions(){
WriteStartTime();
ChangeBtns_frmFlds1();
StartTimer();
}
Well, the only function that works is the WriteStartTime function.
function WriteStartTime()
{ frmTIMETRACKING.hdnAction.value = 'Start';
frmTIMETRACKING.submit();
return false;
}
function ChangeBtns_frmFlds1()
{
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 == "")
{
alert("You must enter number of batches.");
return false;
}
}
}
//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 == "")
{
alert("You must enter comments.");
return false;
}
}
}
//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 == "")
{
alert("You must enter comments.");
return false;
}
}
}
document.frmTIMETRACKING.btnStop.disabled = false;
document.frmTIMETRACKING.btnStart.disabled = true;
document.frmTIMETRACKING.drpeFUNCAREA.disabled = true;
document.frmTIMETRACKING.drpeSUBFUNC.disabled = true;
document.frmTIMETRACKING.veBatches.disabled = true;
document.frmTIMETRACKING.veCOMMENTS.disabled = true;
return false;
}
var timerID = 0;
var tStart = null;
function UpdateTimer() {
if(timerID) {
clearTimeout(timerID);
clockID = 0;
}
if(!tStart)
tStart = new Date();
var tDate = new Date();
var tDiff = tDate.getTime() - tStart.getTime();
tDate.setTime(tDiff);
document.frmTIMETRACKING.theTime.value = ""
+ tDate.getMinutes() + ":"
+ tDate.getSeconds();
timerID = setTimeout("UpdateTimer()", 1000);
}
function StartTimer() {
tStart = new Date();
document.frmTIMETRACKING.theTime.value = "00:00";
timerID = setTimeout("UpdateTimer()", 1000);
return false;
}
...onclick='DoMultipleActions()'
function DoMultipleActions(){
WriteStartTime();
ChangeBtns_frmFlds1();
StartTimer();
}
Well, the only function that works is the WriteStartTime function.
function WriteStartTime()
{ frmTIMETRACKING.hdnAction.value = 'Start';
frmTIMETRACKING.submit();
return false;
}
function ChangeBtns_frmFlds1()
{
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 == "")
{
alert("You must enter number of batches.");
return false;
}
}
}
//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 == "")
{
alert("You must enter comments.");
return false;
}
}
}
//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 == "")
{
alert("You must enter comments.");
return false;
}
}
}
document.frmTIMETRACKING.btnStop.disabled = false;
document.frmTIMETRACKING.btnStart.disabled = true;
document.frmTIMETRACKING.drpeFUNCAREA.disabled = true;
document.frmTIMETRACKING.drpeSUBFUNC.disabled = true;
document.frmTIMETRACKING.veBatches.disabled = true;
document.frmTIMETRACKING.veCOMMENTS.disabled = true;
return false;
}
var timerID = 0;
var tStart = null;
function UpdateTimer() {
if(timerID) {
clearTimeout(timerID);
clockID = 0;
}
if(!tStart)
tStart = new Date();
var tDate = new Date();
var tDiff = tDate.getTime() - tStart.getTime();
tDate.setTime(tDiff);
document.frmTIMETRACKING.theTime.value = ""
+ tDate.getMinutes() + ":"
+ tDate.getSeconds();
timerID = setTimeout("UpdateTimer()", 1000);
}
function StartTimer() {
tStart = new Date();
document.frmTIMETRACKING.theTime.value = "00:00";
timerID = setTimeout("UpdateTimer()", 1000);
return false;
}