473,892 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form variables missing - tried googling, but still not working

Hi there,

I have a bizarre problem with FORM variables in ASP.

Scenario using VI6, IE6, Windows2000 server:

MyPage.ASP:
..
..
..
<FORM method=POST action=Process. ASP id=frmDetails>
<INPUT name=txtName id=txtName type=text>
<INPUT name=txtAddress id=txtName type=text>
</FORM>
..
..
..

If this form is submitted, then i can inspect Request.Form in the
debugger, and both variables are there.

Now, I have a 3rd form, which is called by a "javascript:win dow.open"
call, with txtName.value as a parameter. This form queries a database,
and presents a list of possible addresses to match "name". When one is
selected, it goes :
..
..
..
window.opener.t xtAddress.value =<value>
..
..
..

however, when MyPage.ASP is then submuitted, txtAddress doesn't get
sent across.

I have tried using method=GET to inspect the URL, but txtAddress is not
being passed.

Intercepting the submit, and doing an "alert(txtAddre ss.value)" shows
that txtAddress is correctly populated (I knew it was anyway, since I
can see it's contents on the page), however, the
"Request.FOrm(" txtAddress") is returning nothing.

Can anyone help, I have tried googling, but found nothing specific to
my problem.

thanks in advance

J

Jun 5 '06 #1
3 1714
I do not use Both name and ID attributes
I just use one, the name attribute

I would imagine what is happening is the txtName id
for address is holding the value as it is the last text input id in
the form.

Both Name and Address share the same ID


<je*******@hotm ail.com> wrote in message
news:11******** *************@i 39g2000cwa.goog legroups.com...
Hi there,

I have a bizarre problem with FORM variables in ASP.

Scenario using VI6, IE6, Windows2000 server:

MyPage.ASP:
.
.
.
<FORM method=POST action=Process. ASP id=frmDetails>
<INPUT name=txtName id=txtName type=text>
<INPUT name=txtAddress id=txtName type=text>
</FORM>
.
.
.

If this form is submitted, then i can inspect Request.Form in the
debugger, and both variables are there.

Now, I have a 3rd form, which is called by a "javascript:win dow.open"
call, with txtName.value as a parameter. This form queries a database,
and presents a list of possible addresses to match "name". When one is
selected, it goes :
.
.
.
window.opener.t xtAddress.value =<value>
.
.
.

however, when MyPage.ASP is then submuitted, txtAddress doesn't get
sent across.

I have tried using method=GET to inspect the URL, but txtAddress is not
being passed.

Intercepting the submit, and doing an "alert(txtAddre ss.value)" shows
that txtAddress is correctly populated (I knew it was anyway, since I
can see it's contents on the page), however, the
"Request.FOrm(" txtAddress") is returning nothing.

Can anyone help, I have tried googling, but found nothing specific to
my problem.

thanks in advance

J

Jun 5 '06 #2
je*******@hotma il.com wrote:
Hi there,

I have a bizarre problem with FORM variables in ASP.

Scenario using VI6, IE6, Windows2000 server:

MyPage.ASP:
.
.
.
<FORM method=POST action=Process. ASP id=frmDetails>
<INPUT name=txtName id=txtName type=text>
<INPUT name=txtAddress id=txtName type=text>
</FORM>
.
.
.

If this form is submitted, then i can inspect Request.Form in the
debugger, and both variables are there.

Now, I have a 3rd form, which is called by a "javascript:win dow.open"
call, with txtName.value as a parameter. This form queries a database,
and presents a list of possible addresses to match "name". When one is
selected, it goes :
.
.
.
window.opener.t xtAddress.value =<value>
.
.
.

however, when MyPage.ASP is then submuitted, txtAddress doesn't get
sent across.

I have tried using method=GET to inspect the URL, but txtAddress is
not being passed.

Intercepting the submit, and doing an "alert(txtAddre ss.value)" shows
that txtAddress is correctly populated (I knew it was anyway, since I
can see it's contents on the page), however, the
"Request.FOrm(" txtAddress") is returning nothing.

Can anyone help, I have tried googling, but found nothing specific to
my problem.

thanks in advance

J


Seems to work fine for me. here is how I tested it:

<%@ Language=VBScri pt %>
<%
for each key in Request.Form
Response.Write key & ": """ & Request.Form(ke y) & """<BR>"
next
%>
<html><body>
<FORM method=POST action="" id=frmDetails>
<INPUT name=txtName id=txtName type=text>
<INPUT name=txtAddress id=txtName type=text>
<INPUT type="submit" value="Submit" id=submit1 name=submit1>
</FORM>
<INPUT type="button" value="Button" id=button1 name=button1
onclick="window .open('setaddre ss.htm')">
</body></html>

setaddress.htm:
<HTML>
<BODY>

<INPUT type="button" value="Button" id=button1 name=button1
onclick="test() ;" >
<SCRIPT LANGUAGE=javasc ript>
function test()
{
window.opener.f rmDetails.txtAd dress.value='te st';
window.close();
}
</SCRIPT>
</BODY>

</HTML>

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jun 5 '06 #3

Bob Barrows [MVP] wrote:
je*******@hotma il.com wrote:
Hi there,

I have a bizarre problem with FORM variables in ASP.

Scenario using VI6, IE6, Windows2000 server:

MyPage.ASP:
.
.
.
<FORM method=POST action=Process. ASP id=frmDetails>
<INPUT name=txtName id=txtName type=text>
<INPUT name=txtAddress id=txtName type=text>
</FORM>
.
.
Problem solved. And I am so annoyed I missed it, since it nearly killed
me 18 months ago !

I left out one line of code in my cut down example. The one which went
:

txtAddress.disa bled=true.

disabled controls are not POSTed !!!!!

Thanks for your replies all
.

If this form is submitted, then i can inspect Request.Form in the
debugger, and both variables are there.

Now, I have a 3rd form, which is called by a "javascript:win dow.open"
call, with txtName.value as a parameter. This form queries a database,
and presents a list of possible addresses to match "name". When one is
selected, it goes :
.
.
.
window.opener.t xtAddress.value =<value>
.
.
.

however, when MyPage.ASP is then submuitted, txtAddress doesn't get
sent across.

I have tried using method=GET to inspect the URL, but txtAddress is
not being passed.

Intercepting the submit, and doing an "alert(txtAddre ss.value)" shows
that txtAddress is correctly populated (I knew it was anyway, since I
can see it's contents on the page), however, the
"Request.FOrm(" txtAddress") is returning nothing.

Can anyone help, I have tried googling, but found nothing specific to
my problem.

thanks in advance

J


Seems to work fine for me. here is how I tested it:

<%@ Language=VBScri pt %>
<%
for each key in Request.Form
Response.Write key & ": """ & Request.Form(ke y) & """<BR>"
next
%>
<html><body>
<FORM method=POST action="" id=frmDetails>
<INPUT name=txtName id=txtName type=text>
<INPUT name=txtAddress id=txtName type=text>
<INPUT type="submit" value="Submit" id=submit1 name=submit1>
</FORM>
<INPUT type="button" value="Button" id=button1 name=button1
onclick="window .open('setaddre ss.htm')">
</body></html>

setaddress.htm:
<HTML>
<BODY>

<INPUT type="button" value="Button" id=button1 name=button1
onclick="test() ;" >
<SCRIPT LANGUAGE=javasc ript>
function test()
{
window.opener.f rmDetails.txtAd dress.value='te st';
window.close();
}
</SCRIPT>
</BODY>

</HTML>

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Jun 5 '06 #4

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

Similar topics

4
5799
by: sean | last post by:
HI All, I have a function that validates a form, when the function returns true or false it still does not submit the form. I am using a <div> tag with text to submit the form. I have tried the following ways to make the form submit & validate at the same time; 1. I have tried the onsubmit function at the top of the form, this seems to only work with a form button or an image.
8
2901
by: Neil | last post by:
I have a very puzzling situation with a database. It's an Access 2000 mdb with a SQL 7 back end, with forms bound using ODBC linked tables. At our remote location (accessed via a T1 line) the time it took to go to a record was very slow. The go to mechanism was a box that the user typed the index value into a combo box, with very simple code attached: with me.RecordsetClone .FindFirst " = " & me.cboGoTo If Not .NoMatch Then Me.Bookmark...
25
10300
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
9
3988
by: Lyn | last post by:
Hi, I have a form which is opened from a button on another form. The form is used to display a list of records from a recordset in Continuous Mode. It is sized vertically to display about 25 rows and has a vertical scrollbar. This form has been working perfectly for weeks. However, I must have done something recently because now the detail section displays only one row at a time. That is, the form has shrunk vertically to about 3 cm...
17
2470
by: Dav risson | last post by:
now in my web I have some global variables to be used in many different subpages, in the old ASP I simply loaded a variables.asp file into memory using the eval() function. Now I'd like to use XML but what method would I use to load the entries from the xml file into memory and make them quickly accessible globally in the web code? Just need to know what functions specifically I should start reading about! Thx
27
4788
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it appears that the data goes straight to the processing page, rather than the javascript seeing if data is missing and popping up an alert. I thought it may be because much of the form is populated with data from the db (lists, etc.), but when I leave...
12
2376
by: Rob | last post by:
Let's say you open Form1 that contains TabControl1 There are several tabs on TabControl1 Now you open a new Form2 that contains a User Control How can you determine the Selected tab in Form1 from the User Control in Form2 ? Hope this is clear enough...
7
10304
xNephilimx
by: xNephilimx | last post by:
lHi guys! I'm having a little problem that's getting on my nerves, I couldn't find a solution, I also tryed googling it and I found nothing... (my field of expertise is in AS 2 and 3, but I still lack some JavaScript solid knowdlege) The problem is that when I try to send a form's content with Ajax (I'm using the prototype library), for some reason the latin characters (accents and stuff, like ) turn a mess when I try to store them in...
9
5286
by: stack | last post by:
Hi all, I am creating a web app using JSP. I have a bean with some variables whose values are set by the user by using a form in a jsp (method is post). When the user enters those values these are stored in my bean and they are available to all my jsps since I'm creating a "session". So, after the submission of the form the values are still displayed in the form and this is exactly what I want. In my jsp I have an if statement which causes...
0
9830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11241
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
10926
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
7172
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
5857
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...
0
6065
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4683
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
4279
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3288
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.