Closed Bug 300073 Opened 19 years ago Closed 19 years ago

Problem handling Javascript

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: chris, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

function btnUpdate_onClick(iDayNo){
	var f = document.forms[0];
	alert('You are about to make changes to an Aircraft calendar\n\n' +
			'If this results in a member having their booking cancelled they\n' +
			'will automatically receive a notification email\n\n\n');

		var values = '';
		var slots = '';
		var bookingIDs = '';
		var msg = '';
		msg = 'Form : ' + f.name + '\n';
		msg += ' Table = ' + '<%=strAirCraftCalendarTable%>' + '\n\n'
		msg += ' DayNo = ' + iDayNo + '\n\n'
		// NOTE: FireFox Browser falls over at this line of code
		//
			values += f.elements('hdn_' + iDayNo + '_AM').value + ',';
			slots += f.elements('hdn_' + iDayNo + '_AM').Slot + ',';
			bookingIDs += f.elements('hdn_' + iDayNo + '_AM').BookingID + ',';

		
			values += f.elements('hdn_' + iDayNo + '_PM').value + ',';
			slots += f.elements('hdn_' + iDayNo + '_PM').Slot + ',';
			bookingIDs += f.elements('hdn_' + iDayNo + '_PM').BookingID + ',';
		var URL;
		URL = "";
		URL += "UpdateHireACCalendar.asp?action=Update";
		URL += "&Table=<%=strAirCraftCalendarTable%>";
		URL += "&Values=" + values;
		URL += "&Slots=" + slots;
		URL += "&BookingIDs=" + bookingIDs;
		URL += "&DayNo=" + iDayNo;
		URL += "&acid=" + <%=strAirCraftID%>;
		URL += "&MonthNo=" + <%=MonthNo%>;		
		
		window.location = URL;

	}


Reproducible: Always

Steps to Reproduce:
1. Clicking on 'Update' button
2.
3.

Actual Results:  
Nothing happens at all!!

Expected Results:  
Moved to 'UpdateHireACCalendar.asp' which saves the data to the DB.
f.elements is a collection not a method, it needs to be accessed with square
brackets not parenthesis:

http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-40002357
Coding error - using () brackets instead of []
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.