Jump to content

Multi-Condition Scripting Issue


Recommended Posts

I am trying to set up conditions for a change order form. I need to allow users to submit a form and have it marked as unapproved and in a "New Request" status. If the user is one of the project leads (2 leads assigned to each project), and they are submitting a change request for their own project, the request needs to be marked as approved and the status updated to "In Process". Below is the script that I currently have in my footer but the it's not working. Any suggestions?

<SCRIPT>
 
function Updatestatus()
{
if ("[@authfield:Employee_Profile_Full_Name]"==document.getElementByName("InsertRecordProject_Manager_Assignment")[0].value || "[@authfield:Employee_Profile_Full_Name]"==document.getElementByName("InsertRecordProject_Engineer_Assignment")[0].value)
{
document.getElementsByName("InsertRecordApproval_Status")[0].checked="true";
document.getElementsByName("InsertRecordEC_Status")[0].value="In Process";
document.getElementsByName("cbParamVirtual1")[0].value="Assign Editor and Reviewers";
document.getElementsByName("cbParamVirtual2")[0].value="Go to review window";
document.getElementsByName("cbParamVirtual6")[0].value="Update notification";
document.getElementsByName("cbParamVirtual7")[0].value="Set Reviewers";
}

else if ("[@authfield:Employee_Profile_Full_Name]"!=document.getElementByName("InsertRecordProject_Manager_Assignment")[0].value || "[@authfield:Employee_Profile_Full_Name]"!=document.getElementByName("InsertRecordProject_Engineer_Assignment")[0].value)
{
document.getElementsByName("InsertRecordApproval_Status")[0].checked=="false";
document.getElementsByName("InsertRecordEC_Status")[0].value="New Request";
document.getElementsByName("cbParamVirtual1")[0].value="View Details";
document.getElementsByName("cbParamVirtual2")[0].value="View details page";
document.getElementsByName("cbParamVirtual6")[0].value="Request received";
document.getElementsByName("cbParamVirtual7")[0].value="Pending Changes Report";
}

}
 document.getElementById("caspioform").onchange = Updatestatus;
</SCRIPT>

 

Link to comment
Share on other sites

  • 2 weeks later...

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...