Solved

Form.submit(); method not working

Posted on 2004-04-20
11
1,008 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
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…

929 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

15 Experts available now in Live!

Get 1:1 Help Now