473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

problem in javascript form submission with mozilla

I m using a form which is posted through javascript on click of a image.Its working fine in IE but not in mozilla.
can anybody help me out?

my code is



Expand|Select|Wrap|Line Numbers
  1.  print("<form name=\"topPanelForm\" id=\"topPanelForm\" method=\"post\">");     
  2.                      print("<input type=\"hidden\" name=\"sid\" id=\"sid\" value=\"" . $sid . "\">");
  3.                      print("<input type=\"hidden\" name=\"catid\" id=\"catid\" value=\"".$categoryId."\" >");
  4.                      print("<input type=\"hidden\" name=\"subcatid\" id=\"subcatid\" value=\"".$subcategoryId."\" >");
  5.                      print("<input type=\"hidden\" name=\"tabval\" id=\"tabval\" value=\"\" >");
  6.                      print("<input type=\"hidden\" name=\"server_root\" id=\"server_root\" value=\"".$server_root."\" >");
  7.                         print("</form>");
  8.  
  9.  
  10.  
  11.  <input type="image" src=<?php print("\"" . $imgpath . "personal_finance_btn_over.gif\""); ?> name="Personal_fin" width="139" height="34" border="0" id="Personal_finance" value="1:Personal_finance" onclick="setCategory(this.value);" />
  12.  
  13.  
  14.  
  15. function setCategory(cateid)
  16. {    usid=document.topPanelForm.sid.value;
  17.     server_root=document.topPanelForm.server_root.value;
  18.  
  19.     category=cateid.split(":",2);
  20.     cat=category[0];
  21.         id=category[1];
  22.         subcatgid=cat+"01";
  23.         document.topPanelForm.action=server_root+"/login/community.php";
  24.         document.topPanelForm.catid.value=cat;
  25.         document.topPanelForm.subcatid.value=subcatgid;
  26.         document.topPanelForm.tabval.value=cat;
  27.         alert("sid  "+document.topPanelForm.sid.value)
  28.  
  29.           //document.topPanelForm.submit();
  30.         document.getElementById("topPanelForm").submit();
Nov 12 '08 #1
1 1284
acoder
16,027 Expert Mod 8TB
Instead of a mixture of PHP/HTML, show the client-side version.

Your input field is outside the form.
Nov 12 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Rob | last post by:
I have a form - when you click the submit button, it appends a variable to the URL (e.g. xyz.cgi?inputID=some_dynamic_variable) It also opens a new page. Now, that some_dynamic_variable is...
8
by: Prometheus Research | last post by:
http://newyork.craigslist.org/eng/34043771.html We need a JavaScript component which will auto-submit a form after a set period has elapsed. The component must display a counter that dynamically...
15
by: Michael Hill | last post by:
I have this cf script below where the javascript in it works perfectly i.e. a new window opens when I press 'click me' when I call it up using the url in the browser. But when I "POST" to it...
3
by: news.onetel.net.uk | last post by:
I and my friend Karl have spent literally all day trying to find out what is causing my error but we are zapped of any further functionality :) I have a form that adds news records. You select...
2
by: Greg T | last post by:
Hi, I have a rather long form that I don't want people submitting unless they are absolutely sure they are ready. I figured the easiest way to prevent an accidental form submission by way of...
1
by: fogwolf | last post by:
First a basic outline of what I am trying to do: I want to have a page spawn a pop-up when you click "submit" on its form. On this pop-up page there will be another form. When you click "submit"...
14
by: Rene Grothmann | last post by:
I have managed to communicate between forms and Java applets. A button press sends the content of the text area to an applet, a second button gets some text from the applet and puts it into the...
10
by: ljlolel | last post by:
So.. I have a form that submits to an ASP.net site made in C-sharp. The ASP site is not mine, i do not have the server side code. When I submit from my form by pressing the Submit button, I get...
6
by: Stanimir Stamenkov | last post by:
I have a form without a submit button like: <form name="form1" action="" onsubmit="alert('submit ' + this.name);"> <div> <label>Field 1: <input type="text" name="field1"...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.