472,358 Members | 1,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,358 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 1636
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: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

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.