...

View Full Version : coded confusion



h8ids
08-29-2006, 10:23 PM
Trying to get a button to respond under specific circumstances.
I have a hidden field named "RevisionStage". Its value is either 'YES' or 'NO' based upon what is in a database field.
If RevisionStage's value is 'YES', then the EditRecord button should never activate.
But if RevisionStage's value is 'NO', then EditRecord button could become active if any of three checkboxes is checked.

The following doesn't seem to do anything.


function EditON(){
//Checking to see if the revision process has begun
if (document.form2.RevisionStage."YES"){
document.form2.EditRecord.disabled=true;
//checking to see if AcceptDeny value warrents activation of EditRecord button
} else if (document.form2.RevisionStage."NO"){
document.form2.EditRecord.disabled=false;
function Adjust(){
if (document.form2.AcceptDenyChrNO.checked){
document.form2.EditRecord.disabled=false;
} else if (document.form2.AcceptDenyRegNO.checked){
document.form2.EditRecord.disabled=false;
} else if (document.form2.AcceptDenyCCNO.checked){
document.form2.EditRecord.disabled=false;
}
}
}
}

But this code works fine based upon checkbox values


function EditON(){
if (document.form2.AcceptDenyChrNO.checked){
document.form2.EditRecord.disabled=false;
} else if (document.form2.AcceptDenyRegNO.checked){
document.form2.EditRecord.disabled=false;
} else if (document.form2.AcceptDenyCCNO.checked){
document.form2.EditRecord.disabled=false;
}
}

arnyinc
08-29-2006, 10:27 PM
I haven't checked for any other errors but you need to reference the value of RevisionStage.




if (document.form2.RevisionStage.value=="YES")

h8ids
08-29-2006, 10:41 PM
That's was the issue.

Thanks :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum