473,795 Members | 2,766 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.EventArg s) Handles MyBase.Load
Dim key, value As String
Dim sb As New System.Text.Str ingBuilder

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

sb.Append("Form variables -----").Append("<br> <br>")
For Each key In HttpContext.Cur rent.Request.Fo rm.Keys
sb.Append(key). Append(" =
").Append(HttpC ontext.Current. Request.Form(ke y)).Append("<br >")
Next

sb.Append("<br> ").Append("<br> ").Append("Requ est variables
-----").Append("<br> <br>")
For Each key In HttpContext.Cur rent.Request.Qu eryString.Keys
sb.Append(key). Append(" =
").Append(HttpC ontext.Current. Request.QuerySt ring(key)).Appe nd("<br>")
Next

vars.Text = sb.ToString
End Sub
</script>
<HTML>
<HEAD><title>de fault</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="TestVa r()" value="Go">
</form>
</body>
</HTML>
Nov 19 '05 #1
1 3332
I might add that you will find those lines of code executing at:
http://www.mediaa2.com/default.aspx

"GlobalDevelope r" 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.EventArg s) Handles MyBase.Load
Dim key, value As String
Dim sb As New System.Text.Str ingBuilder

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

sb.Append("Form variables -----").Append("<br> <br>")
For Each key In HttpContext.Cur rent.Request.Fo rm.Keys
sb.Append(key). Append(" =
").Append(HttpC ontext.Current. Request.Form(ke y)).Append("<br >")
Next

sb.Append("<br> ").Append("<br> ").Append("Requ est variables
-----").Append("<br> <br>")
For Each key In HttpContext.Cur rent.Request.Qu eryString.Keys
sb.Append(key). Append(" =
").Append(HttpC ontext.Current. Request.QuerySt ring(key)).Appe nd("<br>")
Next

vars.Text = sb.ToString
End Sub
</script>
<HTML>
<HEAD><title>de fault</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="TestVa r()" 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
3692
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"; echo "<form name='formx3' method='post'><input type='text'><input type=button value=go onclick=document.formx3.action='".$var1."'; document.formx3.submit();></form>"; ?> I got it working using the following...but I want to know why the above code...
2
2296
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 fields. Second, it doesn't submit the information (it's supposed to send it to mySql and email it to me.) and lastly, it doesn't bring up the thankyou.php after submitting the form. I don't know enough about PHP to find the problem. If someone could...
2
18360
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 want to detect when the frame has been loaded with the result of the form submit. Of course I have tried some event handlers like onload, onactivate, onreadystatechange, but they do not work in this example. They only seem to work, when the "SRC"...
15
6580
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 the buttons. The problem is when I post a form to itself, the Enter key will not submit the form, it only clears the contents of the text box. The only way I can submit is to click the submit button. Here is a simplified version of my code that I...
11
3009
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 a different value based on the image that is clicked. Lets say the name is "image" and the value is . How do I submit this with javascript? <form name="form1" method="post" action="launch.asp">
0
1898
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 have run into is that the emitted html at the end of the process is slightly different and doesn't work. Please don't be put off by all the source code. All the guts are in this first base class, and it doesn't do much. The rest is trivial...
4
4580
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 forum). I don't use server controls in it (apart from Page). The problem occurs on the page where visitor can post a new messages. Basically, it's a form with couple of
2
2104
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 am developing with VS2003 and on Windows 2000 Server and have all of the service packs for .NET and Windows. The application is running on an intranet and I'm running this test with IE6. Javascript is functional. The logon form has text fields...
26
2816
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 they press next the form generates "How old are you?" 5 times on the page. The customer will answer all 5 questions then press next. Finally, all the local variables get dynamically created and written to a database. I have already taken care of...
1
10828
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 have defined the relavant function method in the code for details) The issue is that when Icall targetForm._submit() method from the newSubmit() function the page I get an 'Object doesn't support this property or method' error I am using IE...
0
10436
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10163
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3722
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.