473,320 Members | 1,887 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,320 software developers and data experts.

submit will not go to action specified

TJS
what is wrong here, the submit will only post page back to itself instead of
specifed action

<SCRIPT language="Javascript">
function Submit_Form(){
document.Form1.Action="cart.asp";
document.Form1.submit();
return false;
}
</SCRIPT>

<FORM METHOD="get" Action="" NAME="Form1">
<INPUT TYPE="button" VALUE="Submit Information" OnClick="Submit_Form()">
</FORM>
Jul 23 '05 #1
7 2487
"TJS" <no****@here.com> wrote in message
news:10*************@corp.supernews.com...
what is wrong here, the submit will only post page back to itself instead of specifed action

<SCRIPT language="Javascript">
function Submit_Form(){
document.Form1.Action="cart.asp";
document.Form1.submit();
return false;
}
</SCRIPT>

<FORM METHOD="get" Action="" NAME="Form1">
<INPUT TYPE="button" VALUE="Submit Information" OnClick="Submit_Form()">
</FORM>


1) ".action" must be lowercase.

2) <script type="text/css>" instead

3) "return false;" does nothing; alternatively, try:

<FORM METHOD="get" Action="" NAME="Form1" onSubmit="return Submit_Form()">
<INPUT TYPE="submit" VALUE="Submit Information">
</FORM>
Jul 23 '05 #2
On Fri, 12 Nov 2004 13:08:07 -0800, TJS <no****@here.com> wrote:

[snip]
<SCRIPT language="Javascript">
Not related to the solution, but the language attribute has been
deprecated for over six years. Use the (required) type attribute instead:

<script type="text/javascript">
function Submit_Form(){
document.Form1.Action="cart.asp";
The problem here is the case. The action property is all lowercase;
capitalisation within the mark-up is relevant in this instance.

Might I ask, what might be, a dumb question: why isn't the action of the
FORM element 'cart.asp' in the first place? Changing it in script...
document.Form1.submit();


....and relying on a script to perform a critical operation, such as form
submission, is doomed to failure on the Web. Pages should be functional
without any scripting.

If this is for a restricted audience, you can get away with more.

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #3
On Fri, 12 Nov 2004 21:31:07 GMT, McKirahan <Ne**@McKirahan.com> wrote:

[snip]
2) <script type="text/css>" instead


You sure about that? :)

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #4
"McKirahan" <Ne**@McKirahan.com> wrote in message
news:vY9ld.399258$D%.59993@attbi_s51...
"TJS" <no****@here.com> wrote in message
news:10*************@corp.supernews.com...
what is wrong here, the submit will only post page back to itself instead
of
specifed action

<SCRIPT language="Javascript">
function Submit_Form(){
document.Form1.Action="cart.asp";
document.Form1.submit();
return false;
}
</SCRIPT>

<FORM METHOD="get" Action="" NAME="Form1">
<INPUT TYPE="button" VALUE="Submit Information"
OnClick="Submit_Form()"> </FORM>


1) ".action" must be lowercase.

2) <script type="text/css>" instead

3) "return false;" does nothing; alternatively, try:

<FORM METHOD="get" Action="" NAME="Form1" onSubmit="return

Submit_Form()"> <INPUT TYPE="submit" VALUE="Submit Information">
</FORM>


Excuse my fat, fast fingers; it should be

2) <script type="text/javascript"> instead
Jul 23 '05 #5
Michael Winter wrote:
[snip]
Might I ask, what might be, a dumb question: why isn't the action of
the FORM element 'cart.asp' in the first place? Changing it in script...
document.Form1.submit();

Perhaps 'cart.asp' needs javascript to be enabled.
Mick
...and relying on a script to perform a critical operation, such as
form submission, is doomed to failure on the Web. Pages should be
functional without any scripting.


Jul 23 '05 #6
TJS wrote:
what is wrong here, the submit will only post page back to itself instead of
specifed action

<SCRIPT language="Javascript">
function Submit_Form(){
document.Form1.Action="cart.asp";
document.Form1.submit();
return false;
}
</SCRIPT>

<FORM METHOD="get" Action="" NAME="Form1">
<INPUT TYPE="button" VALUE="Submit Information" OnClick="Submit_Form()">
</FORM>


I made a test page to change the action and some test target pages so I
could see what page the form was sent to, setting the action property
with javascript works on my IE 6, Netscape 7.2, and Firefox 1.

What browsers are you using?
I used simple test target pages:

default.htm <html><body>default</body></html>
index.htm <html><body>index</body></html>
initial.htm <html><body>initial</body></html>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<title>Untitled</title>
<script type="text/javascript">
function setaction(url){
document.forms['form1'].action=url;
}
function submitform(){
//document.forms['form1'].action="cart.asp";
document.forms['form1'].submit();
return false;
}
function showaction(){
alert('action = '+document.forms['form1'].action);
}
</script>
</head>

<body>
<FORM METHOD="get" Action="initial.htm" NAME="form1">
<br>Set action to "index.htm"&nbsp;&nbsp;&nbsp;<input type="button"
onclick="setaction('index.htm')"; value="index.htm">
<br>Set action to "default.htm"&nbsp;&nbsp;<input type="button"
onclick="setaction('default.htm')"; value="default.htm">
<br>
<br>Show current action&nbsp;&nbsp;&nbsp;&nbsp;<input type="button"
onclick="showaction()"; value="show action">
<br>
<br>Submit Form&nbsp;&nbsp;&nbsp;<INPUT TYPE="button" VALUE="Submit
Information" OnClick="submitform()">
</FORM>

</body>
</html>

Jul 23 '05 #7
TJS
thanks to all
Jul 23 '05 #8

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

Similar topics

19
by: gsb | last post by:
HOW TO: Submit a form to PHP with no return? I need to submit a form for file upload to a PHP script but do not want anything returned. That is the TARGET for the form should be like a null...
2
by: Terence Parker | last post by:
How does one go about submitting a form with a link - but submitting it to a new window AND to a page different to that described within the action="" option of the <form> tag? Say, for example,...
4
by: Sarah | last post by:
Hi all. I have a form, and several text and image links on it that should submit the form with different actions. I prepared a simple page with just the code that's not working. PROBLEM:...
2
by: Margaret Werdermann | last post by:
Hi all: I'm having a nasty time with a particularly difficult piece of code and was hoping someone might be able to help me. I have a FormMail form that originally worked perfectly. Then, I...
8
by: horos | last post by:
hey all, Ok, a related question to my previous one on data dumpers for postscript. In the process of putting a form together, I'm using a lot of placeholder variables that I really don't care...
5
by: rjames.clarke | last post by:
I have the following. $result=mysql_query($sql); $nrows=mysql_num_rows($result); for ($i=0;$i<$nrows;$i++) { $row_array=mysql_fetch_row($result); echo "<form name='testform'...
2
by: Myk Quayce | last post by:
I have a small .aspx page that uses old style forms with client-side JavaScript validation. Everything works fine until I try to upate the database with some new information. I must be doing...
1
by: gzannd | last post by:
I have a problem with submitting a form to a PHP page through a dynamically created IFRAME in IE7. This code works fine in Firefox. However, IE7 submits an empty form--the correct PHP page is...
12
by: Daniel Klein | last post by:
I'm pretty new at php and web stuff so please be gentle with me. I'm trying to get a form to submit when the user presses the Enter key. I do not want to use javascript. I've googled this to...
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...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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.