Solved

Form.submit(); method not working

Posted on 2004-04-20
11
1,015 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

726 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