Hello All,

Your input would be greatly appreciated. I took over a form that basically just has fields that the end user needs to fill out for their trouble ticket.. They answer the questions, then hit 'generate' that will copy the results to the clipboard then the end user will paste the notes on the clipboard into a trouble ticket case.

I can't do the normal validation because of how the generate form works - All fields have to have a value of iField or iLabel. My idea is, if ANY field at all is blank it would prevent the form from generating. or possibly a pop up message that would come up stating they not completed the required forms.

Below is some of the code
Code:
<script language="Javascript">
<!--------------------------------------------------------------------------------------->
<!---------------------------INITIALIZATION AREA----------------------------------------->
<!--------------------------------------------------------------------------------------->
var spanList = document.getElementsByTagName("span")
var divList = document.getElementsByTagName("div")
var formList = document.forms.generic.elements
showHide("everything", "")
<!--------------------------------------------------------------------------------------->
<!-------------------PRIMARY 'FORM PROCESSING' FUNCTION---------------------------------->
<!--------------------------------------------------------------------------------------->
function form_process()
{
var	preappboxText = ""
var	postappboxText = ""
var	sepboxText = " "
var	footboxText = ""
var labelArray = new Array()
var fieldArray = new Array()
var boxText, preappboxText, postappboxText, sepboxText, footboxText
var Labels = document.getElementsByTagName("span")
var Fields = document.forms.generic.elements
var labelLength = Labels.length
var fieldLength = Fields.length
for (var a = 0; a < labelLength; a++)
	{
		if (Labels[a].name == "iLabel")
			if (Labels[a].style.display != "none") {
				{
				tempString = new String(Labels[a].innerHTML)
				labelArray.push(tempString)
				}
			}
    }
for (var b = 0; b < fieldLength; b++)
    {
        if (Fields[b].name == "iField")
			if (Fields[b].style.display !="none") {
				{
				tempString = new String(Fields[b].value)
				fieldArray.push(tempString)
				}
			}
    }
<!-------------------------------------------------------------------------------->
<!--------------------- BEGIN MAIN LOOP TO GENERATE FORM-------------------------->
<!-------------------------------------------------------------------------------->
for (i = 0; i < fieldArray.length; i++)
{
	if ((i == 0) && (fieldArray[i] == ""))
	{
		boxText = "############# CUSTOMER SERVICE CRM FORM #############\n\n"
	}
	if (labelArray[i] == "HARDWARE ISSUE:") {boxText = boxText + "\n############# HARDWARE SPECIFIC INFORMATION #############\n\n"}
	if (labelArray[i] == "REQUIRES DISPATCH TO RESOLVE:") {boxText = boxText + "\n############# DISPATCH SPECIFIC INFORMATION #############\n\n"}
	if (labelArray[i] == "USER ID FOUND IN GLOBAL ADMIN:") {boxText = boxText + "\n############# PASSWORD RESET SPECIFIC INFORMATION #############\n\n"}

	if (labelArray[i] == "ServiceWare Not Needed:") {boxText = boxText + "\n############# SERVICEWARE INFORMATION #############\n\n"}
	if ((labelArray[i] == "Advised the client of the 4 hour response time.") && (document.getElementById("adClient").value == "Yes")) {boxText = boxText + "\n\n############# CLIENT NOTIFICATION #############\n\n"}
	if ((i == 0) && (fieldArray[i] != ""))
	{
		boxText = "############# CUSTOMER SERVICE CRM FORM #############\n\n" + labelArray[i] + sepboxText + fieldArray[i] + "\n"
	}
	else if (labelArray[i] == "Advised the client of the 4 hour response time.")
		{
		if (document.getElementById("adClient").value == "Yes") {boxText = boxText + labelArray[i] + "\n"}
		}
		else if (fieldArray[i] != "")
		{
				if ((labelArray[i] == "ISSUE:") || (labelArray[i] == "TROUBLESHOOTING:") || (labelArray[i] == "ADDITIONAL INFORMATION:"))
						{
							preappboxText = "\n------------------------\n"
							sepboxText = ""
							postappboxText = "\n------------------------\n"
							footboxText = "\n\n"
						}
				boxText = boxText  + preappboxText + labelArray[i] + postappboxText + sepboxText + fieldArray[i] + "\n" + footboxText
			}
        preappboxText = ""
        postappboxText = ""
        sepboxText = " "
        footboxText = ""
}
<!-------------------------------------------------------------------------------->
<!------------------------ END MAIN LOOP TO GENERATION FORM----------------------->
<!-------------------------------------------------------------------------------->

document.getElementById("text_area").value = boxText
Copied = text_area.createTextRange();
Copied.execCommand("Copy");
alert("Text copied to clipboard: \n\n" + boxText)
Thank you so much in advance!