JavaScript submit method doesn't work

  • Thread starter Thread starter Eric George
  • Start date Start date
E

Eric George

Hi,

Has anyone had any success using jscript submit
method in their VS.NET projects?

For example I have some client processing in a script
function then call <form name>.submit();
This won't work. It does however work in a hand coded
html or aspx page.

Any suggestions?
THANKS
 
It does work. Why errors are you experiencing? Try qualifying the form name
document.all.formName.submit()
 
Hi,
I'm not getting any errors. All that happens
is a post but it stays on the same page.
I know that the jscript function is being called since
I put an alert for debugging.
document.all.formname.submit() didn't help.
Alternatively is there a way to do this in a VB script?
Any suggestions?
 
what are you expecting to happen? The page does post so what is it that you
are after?
You can tell if the page posts by watching the page to see if it flashes or
redraws itself. If you want to retrieve the form variables that were
submitted, that is a different story.
 
Hi,
I'm trying to say that my form's action is to go to
another form, yet it doesn't, the original page justs
redraws.
??
 
Hi,
Here's my jscript:
<script>
function GoTo()
{
alert("in GoTo");
document.all.Form1.submit();
}
</script>

and here's my form code:
<form id="Form1" name="Form1" method="post"
action="webform2.aspx" runat="server">
<INPUT id="jscript" type="button" value="jscript submit"
onclick="GoTo()">
<asp:Button id="Submit" runat="server"
Text="Submit"></asp:Button>
</form>

So when I hit the jscript button I get the alert but no
submit to webform2, just stays on webform1. When I hit the
Submit button I get a successful submit to webform2.

??
 
try this instead
put this in your click button event 'opener.location.reload()'. So for
example, this would be in Page B onclick button event and you are wanting to
post to page A. This code would cause Page A to reload. Now, you would have
to store the data that you want to transfer into Session or cache in page B
so that when page A reloads, it pulls the data out of cache and uses it.

makes sense?
 
Back
Top