Jump to content

Javascript If Then --- Need Help


Recommended Posts

I am hoping someone can see a clear error in this code and help me. I am putting this script in the footer of the details page on a "Search and Report" DataPage. I am hoping to have and If... then statement where (a) if Field_A is set to the value "Pending", then Field_B has a value of "Incomplete", or (B) if Field_A is set to the value "Done", then Field_B has a value of "Complete". Otherwise, there will be no change made to Field_B.

Here is what I have:

function checkstatus()

{

var a_status = document.getElementById("EditRecordField_A").value;

var b_status = document.getElementById("EditRecordField_B").value;

if (a_status == 'Pending')

{

b_status = 'Incomplete';

}

if (a_status == 'Done')

{

b_status = 'Complete';

}

document.getElementById('caspioform').onsubmit=checkstatus;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...