Closed Bug 330195 Opened 18 years ago Closed 14 years ago

the "CIBC Group Of Companies - Resume Upload" page doesn't work in Gecko engine, but works in Opera, Konqueror, IE

Categories

(Firefox :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: ydubinsky, Unassigned)

Details

(Whiteboard: [CLOSEME 5-15-2010])

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050927 Debian/1.7.8-1sarge3
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050927 Debian/1.7.8-1sarge3

The java script function on this page doesn't work in all Gecko's browsers: Firefox 1.5, Mozilla 1.7.8, seamonkey1 on Windows and Linux platform. The same page works fine in Opera on Linux and Windows and Konqueror on Linux, even on Links.  
As I see the problem is in f.elements(sElementName) . Java script interpreter stopped here. It small page and I pasted the source with mine debugging outputs in this message in "additonal information" box.

Reproducible: Always

Steps to Reproduce:
1.Easy to reproduce. Try this html page in any other browser: Opera, Konqueror, IE, than in Gecko. Click on "Upload" button and the browser will send either alert  or will navigate to an URL. In Gecko click on "Upload" button has no effect. Java script source stopped on f.elements(sElementName).
2.
3.




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<title>CIBC Group Of Companies - Resume Upload</title>
	<LINK href="css/cibctest.css" type=text/css rel=STYLESHEET>
	<script language="JavaScript" src="../../utilities/util.js"></script>
	<script language="JavaScript">
	function UploadDocument(f){
		if(f.MyDocument.value.length==0){alert("Please select file to upload."); f.MyDocument.focus(); return;} // -- Please select file to upload
		alert("here1");
		var rexp = new RegExp("[.]doc{1}$","gi");
		alert("2");
		f.MyDocument.value = TrimTextInFormElement(f,"MyDocument");
		alert("3");
		if((!rexp.test(f.MyDocument.value)) && ((f.DocumentIsResume.type=='hidden') || (f.DocumentIsResume.checked))){
			alert("Please select a Word document file.");f.MyDocument.focus();return; // -- Please select a Word document file.
		}
		alert("4");
		if(!ValidateFileType(f.MyDocument.value)){alert("Selected file type can not be uploaded.\nPlease select other file for upload."); f.MyDocument.focus(); return;} // -- Selected file type can not be uploaded.\nPlease select other file for upload.
		alert("5");
		f.submit();
	}
	function ValidateFileType(sFileName){
		
		var rexp = new RegExp("[.]js{1}$|[.]vbs{1}$|[.]exe{1}$|[.]com{1}$|[.]bat{1}$|[.]dll{1}|[.]njoyn{1}|[.]asp{1}$","gi");return !rexp.test(sFileName);
	}
	function TrimTextInFormElement(f, sElementName){ alert ("into"+ sElementName);if (f.elements(sElementName)==null) return;	 alert ("into2"); var reLeadTrailSpaces = new RegExp("^\x20{1,}|\x20{1,}$","gi");alert ("into3");	f.elements(sElementName).value = f.elements(sElementName).value.replace(reLeadTrailSpaces,"");}
	</script>
</head>
<body bgcolor="whitesmoke">
<form enctype="multipart/form-data" action="include/xweb_doc_upload_save.asp" method="post">
<input type="Hidden" name="ObjectID" value="477487">
<input type="Hidden" name="ObjectTypeID" value="1">
<input type="Hidden" name="IsTagetUploadServer" value="True">
<input type="Hidden" name="PUBLISH" value="../xweb.asp?page=ResumeUpload&tbtoken=Y1tcQR1QNVB7anJ0N1dWY09NBhcqaVVYdyRMISl9DHldUUIaXkEcLiUuQC4kXmdzdjUY&chk=dFlbQBJZ">
<input type="Hidden" name="XWUID" value="4044">
<input type="Hidden" name="XDOID" value="49229">
<table class="ProfileInputLabel">
	<tr><td colspan="2"><b>CIBC Group Of Companies - Resume Upload</b></td></tr>
	
	<tr>
		<td colspan="2">
			<hr>
			Please click the Browse button below to select your resume in MS Word format located on your computer, then click the Upload button to save it in your profile.<!-- Please click the Browse button below to select your resume in MS Word format located on your computer, then click the Upload button to save it in your profile. -->
			<br>
			<br>
		</td>
	</tr>
	<tr>
		<td colspan="2">
		
		<input style="width: 350px;" name="MyDocument" type="file"><input style="width: 81px;" type="Button" value="Upload" onclick="UploadDocument(document.forms[0]);"><br><!-- upload -->
		
		<input type="Hidden" name="DocumentIsResume" value="True">
		
		<hr>
		</td>
	</tr>
	<tr>
		<td nowrap><b>Last resume upload date:</b></td><!-- Last resume upload date: -->
		<td>22/02/2006 13:10</td>
	</tr>
	<tr>
		<td nowrap><b>Last resume size:</b></td><!-- Last resume size: -->
		<td>48128</td>
	</tr>

</table>	
</form>
<script SRC="validate.js" LANGUAGE="JavaScript"></script>
<SCRIPT LANGUAGE=javascript>
<!--
 var message = "Function disabled"
function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;}}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;}}}
var frm;
var msg;
var pass;
var daysInMonth =new Array(12);
daysInMonth[1] = 31;
daysInMonth[2] = 29;
daysInMonth[3] = 31;
daysInMonth[4] = 30;
daysInMonth[5] = 31;
daysInMonth[6] = 30;
daysInMonth[7] = 31;
daysInMonth[8] = 31;
daysInMonth[9] = 30;
daysInMonth[10] = 31;
daysInMonth[11] = 30;
daysInMonth[12] = 31;
function sb(sfrm)
{ frm=sfrm;pass=true;
 msg = ""

  if (!pass)
 {alert(msg);return false;}
 else
 return true;
}


--></Script>

</body></html>
Sorry, when I submitted the bug the summary text was corrupted. The text should be as the follwoing:
the "CIBC Group Of Companies - Resume Upload" page doesn't work in Gecko engine, but works in Opera, Konqueror, IE
I see this error in the JavaScript Console (Firefox: > Tools):

Error: f.elements is not a function
Line: 29

It seems f.elements(sElementName) should be f.elements[sElementName], see bug 300073 comment 1.
Summary: eror, IEthe "CIBC Group Of Companies - Resume Upload" page doesn't work in Gecko engine, but works in Opera, Konqu → the "CIBC Group Of Companies - Resume Upload" page doesn't work in Gecko engine, but works in Opera, Konqueror, IE
Reporter, are you still seeing this issue with Firefox 3.6.x or later in safe mode? If not, please close. These links can help you in your testing.
http://support.mozilla.com/kb/Safe+Mode
http://support.mozilla.com/kb/Managing+profiles
Whiteboard: [CLOSEME 5-15-2010]
No reply, INCOMPLETE. Please retest with Firefox 3.6.x or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → INCOMPLETE
I tested again. Now it works as expected.
Resolution: INCOMPLETE → FIXED
Resolution: FIXED → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: