473,573 Members | 2,835 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem on FIREFOX with "document.form. submit();"

Hello,

I use the following script inside a page. My page contains : 1 FORM,
Some Hidden fields, and one line of JAVASCRIPT in order to instantly
post the Form.
The problem is that under FIREFOX, the JAVASCRIPT line don't seems to
be correct, because FIREFOX does'nt post the Form... But my javascript
line looks correct to me...

Below is the Script; thanks for your Help in advance.
Alex.

<form action="my_next _page.html" method="POST" name="form1">
<input type="hidden" name="hidden_fi eld1" size="40"
value="some_val ue1">
<input type="hidden" name="hidden_fi eld2" size="40"
value="some_val ue2">
</form>
<!--The following Javascript line doesn't work, but why ?-->
<script language="JavaS cript">window.d ocument.form1.s ubmit();</script>

Thanks... :-)
Jul 23 '05 #1
2 16342
Alex wrote:
Hello,

I use the following script inside a page. My page contains : 1 FORM,
Some Hidden fields, and one line of JAVASCRIPT in order to instantly
post the Form.
The problem is that under FIREFOX, the JAVASCRIPT line don't seems to
be correct, because FIREFOX does'nt post the Form... But my javascript line looks correct to me...

Below is the Script; thanks for your Help in advance.
Alex.

<form action="my_next _page.html" method="POST" name="form1">
<input type="hidden" name="hidden_fi eld1" size="40"
value="some_val ue1">
<input type="hidden" name="hidden_fi eld2" size="40"
value="some_val ue2">
</form>
<!--The following Javascript line doesn't work, but why ?-->
<script language="JavaS cript">window.d ocument.form1.s ubmit();</script>
Thanks... :-)


Who knows, could be the usual timing error. Try onload instead:

<html>
<head>
<script type="text/javascript">

window.onload = function()
{
document.forms[0].submit();
}

</script>
</head>
<body>
..........
..........

Jul 23 '05 #2
as far i can see you just want to pass two values that cannot be
altered by the user to the next page. why use a form at all?

some kind of redirect to "my_next_page.h tm?value1=value &value2=valu e"
will make the values accessible like posted with method="get" and you
can avoid javascript at all (which is always desirable - imho)

micha

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
12394
by: lsarg | last post by:
i've been trying forever to figure out a way to use a regular text link in place of a submit button at the bottom of this. can't get it. i'm just starting to learn php, so i'm stuck. any help at all would be amazing. <?php # Script 12.7 - login.php // This is the login page for the site. // Include the configuration file for error...
3
4663
by: Don | last post by:
I can successfully force submission of a <form> using "document.formname.submit()". But, the submission doesn't appear to occur when used with Netscape. Anybody know why this is happening, and what I can do to get around this? Thanks, Don -----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------...
5
2281
by: Werner Partner | last post by:
On my testpage http://www.sonoptikon.de/test.php I have this <table><tr> <td valign="top" align="center" style="width:150px;"> <form action=test.php method="get">
3
6507
by: Quick | last post by:
.Value is now .setattribute & .getattribute("name", "value") What took the place of .Click? I see .Click is still stated as a method of Forms. I have a reference "xForm" to the exact form I want to click. (A simple submit button at my web site.) xForm is an object that traverses though Document.All until it finds the first form with a...
4
16251
by: dschruth | last post by:
Hello. Can anybody solve this problem? I am using a server-side language (PERL) to *try* to POST data to a HTTPS login script that doesn't have a standard "submit" button. The form appears to use javascript to submit the document via the browser's DOM. <form action='loginScript.cgi' method="post" name="loginForm">
7
1938
by: Rich | last post by:
Hi, I was experimenting with some basic sample asp code but can't get it to work correctly: this is bgselector.asp which works OK - you add the name of a basic color like blue, green, yellow and call another asp called backcolor.asp where I have the problem: bgselector.asp
1
1309
by: abcbook | last post by:
Can anyone explain a get around for this .js file I’m trying to create or tell me if there is one or what am I missing. I Do Not what to put the form Directly on the HTML Page. This .js file will reside on many pages. and I want to be able to quick change the content of the .js file and have all pages automatically update by simply changing...
14
75467
by: white lightning | last post by:
How to have <select onchange="this.form.submit()"and also a Submit button on one form? I have something like this: <form action="<?php $_SERVER; ?>" method="post" enctype="multipart/form-data" name="form1"> <select onchange="this.form.submit();" name="prod"> <option value="">Select product</option> <option value="12">abc</option>
2
3110
by: ChrisLA | last post by:
Hi; I've seen lots of discussion & disagreement on this issue, so any good explanation would be appreciated. Some people seem to think that "document.GetElementByID("MyName").submit(); should and does work. I and others have experienced that it should & doesn't work. I'll give you a little file that I tested with IE 6, FF 3, Opera &...
0
7781
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7699
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8027
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7788
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8066
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5594
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3733
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2216
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1304
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.