Success,
I was able to have the free-text box, attachment button, and save button hide or appear based on the Area Selected by the Customer.
For instance, If a customer chooses to submit a new Inc/Req with the Area of "*CLASSIFIED*", than the text box and attachment buttons are hidden, any data entered already into the text box is overwritten, and an alert message pop-up appears on the customers screen.
If the customer then changes the Area to something other than "*CLASSIFIED*", the text box and attachment button reappear.
If the customer has already selected the attachment button prior to choosing the Area of "*CLASSIFIED*", than the SAVE button will disappear as well.
This was done by adding the following function:
//Change input options if Classified Area is chosen.
function myFunction() {
setTimeout(myTimeout,800)
}
function myTimeout(){
var x = document.getElementById("df_3_0").value;
if (x == '*CLASSIFIED*' || x =='*classified*')
{
alert(x + ": " + "No free text is allowed for Classified Issues on this Unclassified System. Use the drop-down menu below to select the closest match for your issue."); //makes popup displaying Area chosen
document.getElementById("df_5_0").innerHTML = "**WARNING - THIS IS A CLASSIFIED REQUEST OR INCIDENT - DO NOT EDIT WITH CLASSIFIED INFORMATION. DO NOT ATTACH DOCUMENTATION WITH CLASSIFIED INFORMATION. USE DROPDOWN SELECTIONS ONLY!**";//adds required text to text box.
document.getElementById("df_5_0").style.display = "none";//makes textbox disappear.
document.getElementById("imgBtn3").style.display = "none";//makes attachment btn disappear.
if (click !=0) // Hides Save button if an attachment has already been added. Ticket must be deleted.
{document.getElementById("imgBtn0").style.display = "none";//hide Save button.
alert(x + ": " + "PLEASE CANCEL OR CLOSE THIS TICKET WITHOUT SAVING. AN UNAUTHORIZED ATTACHMENT MAY HAVE BEEN SAVED TO THIS TICKET PRIOR TO BEING MARKED AS CLASSIFIED, AND CANNOT BE REMOVED!")
}
}
else
{ document.getElementById("df_5_0").style.display = "inline"; //brings text box back if *CLASSIFIED* area is changed to something else.
document.getElementById("imgBtn3").style.display = "inline"//brings attachment btn back.
}
}
I also added the evt=" onblur=\\\"myFunction()\\\ to the Area select drop-down MACRO as seen below.
<PDM_MACRO name=dtlHier hdr="Incident Area" attr="category" autofill=yes common_name="ss_sym" evt="onChange=\\\"emp_change_category_func('cr')\\\" onblur=\\\"myFunction()\\\"" factory=pcat_cr_ss size=30>
That was one of my first scripts ever written so you'll have to forgive the ugliness of it, but it works.
Thanks again for the help,
Joe