Solved

Form.submit(); method not working

Posted on 2004-04-20
11
1,018 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
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

 
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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