Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > form doesn't submit

Reply
Thread Tools

form doesn't submit

 
 
=?Utf-8?B?R2xvYmFsRGV2ZWxvcGVy?=
Guest
Posts: n/a
 
      12-04-2004
The following simple code which is supposed to enumerate the
form and query variables does work in IE6 and FireFox but NOT
in IE5. Could anyone advice me on this one???

I think the issue has to do with the javascript line
document.forms[0].submit();
in the TestVar function but I just cannot see what is wrong
with that call.

<script runat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim key, value As String
Dim sb As New System.Text.StringBuilder

sb.Append("<br>").Append(Date.Now.ToString("u")).A ppend("<br><br>")

sb.Append("Form variables -----").Append("<br><br>")
For Each key In HttpContext.Current.Request.Form.Keys
sb.Append(key).Append(" =
").Append(HttpContext.Current.Request.Form(key)).A ppend("<br>")
Next

sb.Append("<br>").Append("<br>").Append("Request variables
-----").Append("<br><br>")
For Each key In HttpContext.Current.Request.QueryString.Keys
sb.Append(key).Append(" =
").Append(HttpContext.Current.Request.QueryString( key)).Append("<br>")
Next

vars.Text = sb.ToString
End Sub
</script>
<HTML>
<HEAD><title>default</title></HEAD>
<body>
<script type="text/javascript">
function TestVar()
{
var t = new Date();
document.forms[0].elements["testvar1"].value=t;
document.forms[0].submit();

return true;
}
</script>
<form id="Form1" name="Form1" method="post" runat="server">
<input type="hidden" id="testvar1" value="Hej" runat="server"
NAME="testvar1">
<asp:Label ID="vars" Runat="server"></asp:Label>
<a href="#" onclick="return TestVar();">Go</a>
<input type="button" onclick="TestVar()" value="Go">
</form>
</body>
</HTML>
 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2xvYmFsRGV2ZWxvcGVy?=
Guest
Posts: n/a
 
      12-04-2004
I might add that you will find those lines of code executing at:
http://www.mediaa2.com/default.aspx

"GlobalDeveloper" wrote:

> The following simple code which is supposed to enumerate the
> form and query variables does work in IE6 and FireFox but NOT
> in IE5. Could anyone advice me on this one???
>
> I think the issue has to do with the javascript line
> document.forms[0].submit();
> in the TestVar function but I just cannot see what is wrong
> with that call.
>
> <script runat="server">
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> Dim key, value As String
> Dim sb As New System.Text.StringBuilder
>
> sb.Append("<br>").Append(Date.Now.ToString("u")).A ppend("<br><br>")
>
> sb.Append("Form variables -----").Append("<br><br>")
> For Each key In HttpContext.Current.Request.Form.Keys
> sb.Append(key).Append(" =
> ").Append(HttpContext.Current.Request.Form(key)).A ppend("<br>")
> Next
>
> sb.Append("<br>").Append("<br>").Append("Request variables
> -----").Append("<br><br>")
> For Each key In HttpContext.Current.Request.QueryString.Keys
> sb.Append(key).Append(" =
> ").Append(HttpContext.Current.Request.QueryString( key)).Append("<br>")
> Next
>
> vars.Text = sb.ToString
> End Sub
> </script>
> <HTML>
> <HEAD><title>default</title></HEAD>
> <body>
> <script type="text/javascript">
> function TestVar()
> {
> var t = new Date();
> document.forms[0].elements["testvar1"].value=t;
> document.forms[0].submit();
>
> return true;
> }
> </script>
> <form id="Form1" name="Form1" method="post" runat="server">
> <input type="hidden" id="testvar1" value="Hej" runat="server"
> NAME="testvar1">
> <asp:Label ID="vars" Runat="server"></asp:Label>
> <a href="#" onclick="return TestVar();">Go</a>
> <input type="button" onclick="TestVar()" value="Go">
> </form>
> </body>
> </HTML>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert form to submit on load instead of clicking submit button? Network-Man HTML 5 07-07-2012 12:06 PM
submit 1 form to 2 servers or 2 forms to 2 server (1 form each) on 1 submit abansal.itp@gmail.com Javascript 3 06-23-2007 07:29 AM
Forms with multiple submit buttons vs 'form' objects with single 'submit' methods neil.fitzgerald@ic.ac.uk Python 4 04-14-2006 04:58 PM
submit the form data to the popup window without a submit button jrefactors@hotmail.com HTML 2 01-01-2005 06:07 AM
Form submit - hitting enter does not trigger Submit button ASP General 2 10-25-2004 03:37 PM



Advertisments