Firefox 3.0.10 no longer processing a javascript function

The following function worked in previous versions of Firefox and continues to work in both IE and Google Chrome. The function calls a window that contains a dbase-generated list used to define a database query. Firefox doesn't  even recognize the alerts. Can someone can take a look at the script and flag the stuff that might cause Firefox to choke?
function dmsJS_displayKeywordPickList(form,fieldName,controlType) {
alert("test0");
	var newWin
	var doc
 
alert("test1");
//	alert("name=" + form.name)
//	alert("fieldName=" + fieldName + " controlType=" + controlType)
 
	// Check for netscape browser
	if(document.all)
	   var xMax=screen.width, yMax=screen.height;
	else //IE browser
	   if(document.layers)
	      var xMax=window.outerWidth, yMax=window.outerHeight;
	   else
	      var xMax=640, yMax=480;
 
	var xOffset=(xMax-200)/2, yOffset=(yMax-200)/2;
 
alert("test2");
	newWin = window.open('','wDmsKeyList',
	  'top='+yOffset+',left='+xOffset+',screenX='+xOffset+',screenY='+yOffset+',titlebar=no,toolbar=no,scrollbars=yes,status=no,width=420,height=350,resize=yes')
	
	doc=newWin.document
	doc.write("")
	doc.close()
 
	doc.write("<html>" + "\n")
	doc.write("<head>" + "\n")
	doc.write("<META HTTP-EQUIV='Expires' content='Sunday, 01 Jan 1995 12:00:00 GMT'>")
	doc.write("</head>" + "\n")
	doc.write("<title>Falcon/DMS</title>" + "\n")
	doc.write("<body bgcolor='' onLoad='javascript:document.dmsKeywordList.submit()'>\n")
	doc.write("<table width='100%' height='100%'>")
	doc.write("<tr><td align='center'><font face='Arial' color='BLACK' size=4>")
	doc.write("<b>Building List<br>Please Wait...</b></font>\n")
	doc.write("</tr></td>")
	doc.write("</table>")
	doc.write("<form action='/scripts/falcon/dmsWebLists2.exe' name='dmsKeywordList' Method='Post'>" + "\n")
	//doc.write("<form action='/scripts/falcon/dmstest.exe' name='dmsDirList' Method='Post'>" + "\n")
	doc.write("<input type='hidden' name='sessionid' value='" + "userid" +"'>\n")
	doc.write("<input type='hidden' name='cmd' value='getKeywordList'>\n")
	doc.write("<input type='hidden' name='formName' value=" + form.name + ">\n")
	doc.write("<input type='hidden' name='fieldName' value=" + fieldName + ">\n")
	doc.write("<input type='hidden' name='controlType' value=" + controlType + ">\n")
	for(var ict=0; ict < form.elements.length; ict++) {
	   // Process text fields
	   if(form.elements[ict].name.substring(0,4) == 'dir_'){
	   	//Sumbit the directory level values for the autoGenerate
		if(controlType == 5  || controlType == 8){
			doc.write("<input type='hidden' name='" + form.elements[ict].name + "' " + 
		  	"value='" + form.elements[ict].value + "'>\n")
		}
	   }
	   if(form.elements[ict].name.substring(0,7) == 'keyword' ||
		form.elements[ict].name.substring(0,5) == 'ffmtk'){
	   	//Sumbit the keyword values for any hiearchical keywords
		if(controlType == 4 || controlType == 5 || controlType == 6 || controlType == 8){
			doc.write("<input type='hidden' name='" + form.elements[ict].name + "' " + 
		  	"value='" + form.elements[ict].value + "'>\n")
		}
	   }
	   if(form.elements[ict].name == 'file_format' ||
		form.elements[ict].name == 'drawing_status'){
	   	//Sumbit values needed for auto-generate
		if(controlType == 5 || controlType == 8){
			doc.write("<input type='hidden' name='" + form.elements[ict].name + "' " + 
		  	"value='" + form.elements[ict].value + "'>\n")
		}
	   }
 
	} // end for
 
	doc.write("</form></body></html>")
	doc.close()
	newWin.focus()
	//doc.dmsDirList.submit() did not work on the MAC, switch to body onLoad
 
	//return false
}

Open in new window

tsynnottAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

abelCommented:
Can you show the same code with the <script> and the html code that comes with it so that we can test it and amend it?

(btw & OT, the document.all is supported by IE, not by netscape, which used to support document.layers, your if statement is the other way around, but that's only a comment, and does not involve code execution).
0
dlastleeCommented:
If the first alert is not executing, the error is either the code prior to the function call or the function is not being called. If other browsers are still working, I would guess the former so I would check that the code is executing up to the point of the call.

I tested the script. At least the first few lines are executing in FF3, so that enforces that the error is prior to the function call.
0
tsynnottAuthor Commented:
abel and dlastlee
Thanks for your attention to this issue (sorry it took so long to respond).

Before I proceed further with your recommendations, I discovered something that may add to your understanding of my problem: The search form that produces the problem I described is programmatically generated using a 'template' html file that with the xhtml-strict.dtd DocType declaration in the header (one of our client's 508 compliance requirements).

During my latest troubleshooting, I changed the DocType to the transitional declaration, which didn't work, and then to <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">, which did work! I talked to one of my programmers about this and it was suggested that the problem probably relates to how the form's name/id is being processed, and that the problem will be addressed in the coming version release. Based on this information, if you can think of anything else I would appreciate hearing from you. In the meantime, we're probably just going to go with changing the DocType for that form and address the problem more completely in the next release.

Regards,
tsynnott
0
dlastleeCommented:
That is clearly possible. Transitional and Strict are both more strict on the syntax, than the more lenient HTML 3.2 Final DOCTYPE which would allow you a temporary relief to the issue.

To find the root cause still requires the same type of debugging, in your case, more alerts prior to the function provided. The script will still end when it reaches a run-time error except it would be earlier than a more lenient type. Another possibility is to use FF error console which may be able to provide you more clues to locating the error.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.