Expand|Select|Wrap|Line Numbers
- javascript:savesubmit('form31','results31','1','movies','178')
This is the JavaScript function savesubmit:
Expand|Select|Wrap|Line Numbers
- function savesubmit(formname, loc, noofvenues, which, mapid)
- {
- var f = document.forms[formname];
- alert(f);//this alert was to test if the form name was coming in properly
- var params = "";
- for (i=0;i < (f.elements.length);i++) {
- params = params + f.elements[i].name +'='+ encodeURI(f.elements[i].value) + '&';
- }
- shows = loc;
- xmlHttp=GetXmlHttpObject();
- if (xmlHttp==null)
- {
- alert ("Browser does not support HTTP Request");
- return;
- }
- var url = 'http://www.mysite.com/section/myspace/save.php/'+which+'/'+f.eventid.value+'/1/'+mapid+'/'+noofvenues
- var eventid = f.eventid.value;
- url = url + "?" + params;
- var update_loc = eventid + 'save';
- var update_form = eventid;
- xmlHttp.onreadystatechange=stateChangedALL;
- xmlHttp.open("GET",url,true);
- xmlHttp.send(null);
- updatesave(update_form, update_loc, noofvenues, which, mapid);
- }
The problem is, this thing is working in IE but not in FF. When I click on the Save link, it says "'elements.length' is null or not an object". And the alert I put for testing says [object] instead of giving the form name.
Here is the <td> which has the forms etc.
Expand|Select|Wrap|Line Numbers
- <TD WIDTH="510" BGCOLOR="#FFFFFF" VALIGN="TOP" STYLE='padding-right: 10'>
- <A HREF="/profile/movies/31"><SPAN CLASS="Basic_LARGE_BLUE_LINK">Cheeni Kum</SPAN></A>
- <BR>
- <SPAN CLASS="Basic_LARGE_NORMAL">64-year-old Buddhadeb is single and lives with mom. Now, aren't the possibilities endless?</SPAN>
- <BR>
- <BR><A HREF='/profile/locations/178'>PVR Cinema (Punjagutta)</A> (13.3 km)
- <BR><BR>
- <DIV id="31save" STYLE="float:left">
- <A HREF="/profile/movies/31/1">Rate</A> •
- <A HREF="javascript:savesubmit('form31','results31','1','movies','178')">Save</A> •
- <A HREF="/profile/locations/178/4">Map</A> <DIV STYLE="clear:both;"></DIV>
- </DIV>
- <FORM NAME="deleteform31" STYLE="margin:0px">
- <INPUT TYPE="hidden" NAME="eventid" VALUE="31">
- <INPUT TYPE="hidden" NAME="edittype" VALUE="delete">
- </FORM>
- <FORM NAME="form31" STYLE="margin:0px">
- <INPUT TYPE="hidden" NAME="eventid" VALUE="31">
- <INPUT TYPE="hidden" NAME="edittype" VALUE="update">
- </FORM>
- <DIV STYLE="clear:both"></DIV>
- <DIV id="results31" ></DIV>
- </TD>