Solved

Form.submit(); method not working

Posted on 2004-04-20
11
1,007 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
Comment Utility
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
Comment Utility
The file is .asp.
0
 

Author Comment

by:NJordan72
Comment Utility
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
 
LVL 25

Expert Comment

by:devic
Comment Utility
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
Comment Utility
ach, mysubmit is already function :)

then submit --> mySubmitBtn
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:NJordan72
Comment Utility
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
Comment Utility
make sure, that you don't use somewhere else name "submit"
search for word "submit"
0
 
LVL 63

Expert Comment

by:Zvonko
Comment Utility
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
Comment Utility
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
Comment Utility
so give 95% that you have some field with name=submit
0
 
LVL 25

Expert Comment

by:devic
Comment Utility
oops too late, didn't refresh :)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now