Solved

Form.submit(); method not working

Posted on 2004-04-20
11
1,011 Views
Last Modified: 2012-06-21
This seems to have just happened.  I'm using IE6 on XP.  Below is the code snippit.

<form action="edit_segment_confirm.asp<%if request.querystring("callback")=1 then response.write("?callback=1&dayID=" & request.querystring("dayID")) end if%>" method="post" id="pageform" name="pageform">
<script type="text/javascript">
<!--
function mySubmit(sID, sDesc, locArg)
{
  document.forms["pageform"].action='edit_segment_add.asp?sID=' + sID + '&sDesc=' + sDesc + '&location='+ locArg;
  //alert(document.forms["pageform"].action);
  document.forms["pageform"].method='post';
  document.forms["pageform"].submit();
}
//-->
</script>

When I call mySubmit() I get a method not supported error message for the last line of the script.  It is basically telling me the submit(); method doesn't exist.  Am I overlooking something simple?

Nick
0
Comment
Question by:NJordan72
  • 6
  • 4
11 Comments
 
LVL 25

Expert Comment

by:devic
ID: 10870385
rename file from *.html to *.asp

or

remove <%if request.querystring("callback")=1 then response.write("?callback=1&dayID=" & request.querystring("dayID")) end if%>"
0
 

Author Comment

by:NJordan72
ID: 10870397
The file is .asp.
0
 

Author Comment

by:NJordan72
ID: 10870409
Here is the same snippit after the ASP is processed
-------------

<form action="edit_segment_confirm.asp" method="post" id="pageform" name="pageform">
<script type="text/javascript">
<!--
function mySubmit(sID, sDesc, locArg)
{
  document.forms["pageform"].action='edit_segment_add.asp?sID=' + sID + '&sDesc=' + sDesc + '&location='+ locArg;
  //alert(document.forms["pageform"].action);
  document.forms["pageform"].method='post';
  document.forms["pageform"].submit();
}
//-->
</script>
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 25

Expert Comment

by:devic
ID: 10870439
ok then then change name of field below

from
<input name=submit onclick=mySubmit("aa", "aa", "aa")>

to
<input name=MYsubmit onclick=mySubmit("aa", "aa", "aa")>

or somewhere else rename SUBMIT to MYSUBMIT

and avoid using reserverd words in the future ;)

0
 
LVL 25

Expert Comment

by:devic
ID: 10870460
ach, mysubmit is already function :)

then submit --> mySubmitBtn
0
 

Author Comment

by:NJordan72
ID: 10870475
Actually it isn't used on a submit button, but a link.

<a href="#" onclick="mySubmit(131492, '06/04/03-800', 'add_juris.asp'); return false;">Add Jurisdiction</a>

The submit button does look like this though:

<input type="submit" name="submitx" />
0
 
LVL 25

Accepted Solution

by:
devic earned 125 total points
ID: 10870497
make sure, that you don't use somewhere else name "submit"
search for word "submit"
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 10870533
The presented ASP code here does not contain a syntax error. But I could imagine that the generated HTML source code for the browser contains some invalid insertations, for example in the <form> tag.
So please, could we see some example of generated html code from the browser?

0
 

Author Comment

by:NJordan72
ID: 10870552
I had added another submit button at the top of the page some while ago (because the page is several pages long).  Made the mistake of naming it submit.  Thanks!
0
 
LVL 25

Expert Comment

by:devic
ID: 10870567
so give 95% that you have some field with name=submit
0
 
LVL 25

Expert Comment

by:devic
ID: 10870578
oops too late, didn't refresh :)
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question