Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: coded confusion

  1. #1
    Regular Coder
    Join Date
    Jan 2006
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question coded confusion

    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.

    Code:
    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

    Code:
    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;
    	}
    }

  • #2
    Regular Coder
    Join Date
    Jan 2003
    Posts
    867
    Thanks
    4
    Thanked 8 Times in 8 Posts
    I haven't checked for any other errors but you need to reference the value of RevisionStage.


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

  • #3
    Regular Coder
    Join Date
    Jan 2006
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That's was the issue.

    Thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •