473,395 Members | 1,613 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

form doesn't submit

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>
Nov 19 '05 #1
1 3313
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>

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bruce Duncan | last post by:
I can't seem to figure our why this doesn't work. I don't get any errors, it just doesn't submit. Can anyone shed some light. <?PHP $var1 = "http://localhost/php/index.php"; $varx = "bruce";...
2
by: iwasinnihon | last post by:
I don't usually like to do this, but I need help. I have gone over this code and cannot figure out why it doesn't work. First of all it doesn't check to see if you have filled in the required...
2
by: Halldór Ísak Gylfason | last post by:
In my application I have an iframe that is empty (and not visible) initially, however when a user presses a button a form is programmatically submitted and the target is set to the IFrame. I...
15
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
11
by: Brian D | last post by:
I have been searching for a while to find an answer to this and I must be searching on the wrong keywords. Below is a snippet of my form. There are other form items on it, but I need to submit...
0
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
4
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
2
by: Wysiwyg | last post by:
I'm going back to a previous asp.net (C#) web project after a few months of inactivity and my first form, the login, won't submit. I ran with the debugger and still can't see how to resolve this. I...
26
by: Jerim79 | last post by:
I need to create a form that takes a number that the user enters, and duplicates a question the number of times the user entered. For instance, if the customer enters 5 on the first page, when...
1
by: gbezas | last post by:
Hi All, I have added an event handler to redirect form.submit() to a newSubmit() method that I have defined (which does some additional processing before submitting the form). Additionally I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.