473,382 Members | 1,349 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,382 software developers and data experts.

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:window.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.txtAddress.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(txtAddress.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 1687
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*******@hotmail.com> wrote in message
news:11*********************@i39g2000cwa.googlegro ups.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:window.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.txtAddress.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(txtAddress.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*******@hotmail.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:window.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.txtAddress.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(txtAddress.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=VBScript %>
<%
for each key in Request.Form
Response.Write key & ": """ & Request.Form(key) & """<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('setaddress.htm')">
</body></html>

setaddress.htm:
<HTML>
<BODY>

<INPUT type="button" value="Button" id=button1 name=button1
onclick="test();" >
<SCRIPT LANGUAGE=javascript>
function test()
{
window.opener.frmDetails.txtAddress.value='test';
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*******@hotmail.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.disabled=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:window.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.txtAddress.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(txtAddress.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=VBScript %>
<%
for each key in Request.Form
Response.Write key & ": """ & Request.Form(key) & """<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('setaddress.htm')">
</body></html>

setaddress.htm:
<HTML>
<BODY>

<INPUT type="button" value="Button" id=button1 name=button1
onclick="test();" >
<SCRIPT LANGUAGE=javascript>
function test()
{
window.opener.frmDetails.txtAddress.value='test';
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
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...
8
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...
25
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...
9
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...
17
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...
27
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...
12
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...
7
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...
9
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.