473,408 Members | 2,734 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,408 software developers and data experts.

Request.Form(var) empty with IE, works fine with Firefox. Help please.

Hi,

I've been trawling the web for answer to my problem with no luck
although I'm hardly alone it seems!

Below is the generated source for an ASP page that posts a value called
'album' to another ASP page. The other page retrieves the value with
Request.Form('album'); On Firefox this works fine every time. On IE6, I
always get nothing. I'm pretty sure it's the posting side that is at
fault, so that's what I've shown here. Oh, I tried Request.QueryString
too and again, fine on Firefox, nothing on IE6.

Any help would be much appreciated.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>Gallery</title>
<!--mstheme-->
<link rel="stylesheet" type="text/css"
href="_themes/poetic2/poet1011.css">
<meta name="Microsoft Theme" content="poetic2 1011, default">
</head>
<body>
<form name='albumselect' action="gallery_intro.asp" method="post"
target="intro">
<CENTER><h2>ALBUMS</h2></CENTER><hr><br>
<CENTER><input name='album' type=image src='photogallery/Test
One/Title.jpg' value='photogallery/Test One'
onClick='submit();'></CENTER>
<CENTER>Test One Photos</CENTER><br><hr><br>
<CENTER><input name='album' type=image src='photogallery/Test
Two/Title.jpg' value='photogallery/Test Two'
onClick='submit();'></CENTER>
<CENTER>Test Two Photos</CENTER><br><hr><br>
<CENTER><input name='album' type=image src='photogallery/Test
Three/Title.jpg' value='photogallery/Test Three'
onClick='submit();'></CENTER>
<CENTER>Test Three Photos</CENTER><br><hr><br>
</form>
</body>
</html>

Regards,

Dave

Sep 1 '06 #1
9 7006
Can you give your ASP code? Also, what's "submit()?" An <input
type="image"will submit the form when clicked already.

Ray at work

"Dave" <da**@seafaretech.co.ukwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Hi,

I've been trawling the web for answer to my problem with no luck
although I'm hardly alone it seems!

Below is the generated source for an ASP page that posts a value called
'album' to another ASP page. The other page retrieves the value with
Request.Form('album'); On Firefox this works fine every time. On IE6, I
always get nothing. I'm pretty sure it's the posting side that is at
fault, so that's what I've shown here. Oh, I tried Request.QueryString
too and again, fine on Firefox, nothing on IE6.

Any help would be much appreciated.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>Gallery</title>
<!--mstheme-->
<link rel="stylesheet" type="text/css"
href="_themes/poetic2/poet1011.css">
<meta name="Microsoft Theme" content="poetic2 1011, default">
</head>
<body>
<form name='albumselect' action="gallery_intro.asp" method="post"
target="intro">
<CENTER><h2>ALBUMS</h2></CENTER><hr><br>
<CENTER><input name='album' type=image src='photogallery/Test
One/Title.jpg' value='photogallery/Test One'
onClick='submit();'></CENTER>
<CENTER>Test One Photos</CENTER><br><hr><br>
<CENTER><input name='album' type=image src='photogallery/Test
Two/Title.jpg' value='photogallery/Test Two'
onClick='submit();'></CENTER>
<CENTER>Test Two Photos</CENTER><br><hr><br>
<CENTER><input name='album' type=image src='photogallery/Test
Three/Title.jpg' value='photogallery/Test Three'
onClick='submit();'></CENTER>
<CENTER>Test Three Photos</CENTER><br><hr><br>
</form>
</body>
</html>

Regards,

Dave

Sep 1 '06 #2
Dave wrote:
Hi,

I've been trawling the web for answer to my problem with no luck
although I'm hardly alone it seems!

Below is the generated source for an ASP page that posts a value
called 'album' to another ASP page. The other page retrieves the
value with Request.Form('album'); On Firefox this works fine every
time. On IE6, I always get nothing. I'm pretty sure it's the posting
side that is at fault, so that's what I've shown here.
If so, a client-side newsgroup would have been more appropriate (ASP only
concerns server-side activity). But, read on ...
Oh, I tried
Request.QueryString too and again, fine on Firefox, nothing on IE6.

Any help would be much appreciated.
In the future, when posting html, remove everything that's not related to
reproducing the problem, please. For example, we have no access to your
style sheets, etc. so there's no need to show us those tags. Further: you
have three image inputs with the same name. Does the problem only occur when
you have more than one input with the same name?

Here is my attempt to reproduce your problem (and yes, I did test the
difference between one and more than one input):
<%@ Language=VBScript %>
<%
if Request.Form.Count0 then
Response.Write "Request.Form(""album.x"") contains<br>"
Response.Write Request.Form("album.x") & "<br>"
Response.Write "Request.Form(""album.y"") contains<br>"
Response.Write Request.Form("album.y") & "<br>"
else
Response.Write "No Form variables"
end if
%>
<HTML>
<BODY>
<form name='albumselect' method="post">
<CENTER><h2>ALBUMS</h2></CENTER><hr><br>
<CENTER><input name='album' type=image src='images/vba3626.gif'
value='photogallery/Test One'
onClick='albumselect.submit();'></CENTER>
<CENTER>Test One Photos</CENTER><br><hr><br>
<CENTER><input name='album' type=image
src='images/vba3626_2.gif' value='photogallery/Test Two'
onClick='albumselect.submit();'></CENTER>
<CENTER>Test Two Photos</CENTER><br><hr><br>
<CENTER><input name='album' type=image
src='images/vba3626.gif' value='photogallery/Test Three'
onClick='albumselect.submit();'></CENTER>
<CENTER>Test Three Photos</CENTER><br><hr><br>
</form>
</BODY>
</HTML>
Everything works as expected. What are you doing differently? Are you
attempting to get the value propert? If so, the online docs at msdn state:

The x-coordinate is submitted under the name of the control with .x
appended, and the y-coordinate is submitted under the name of the control
with .y appended. Any value property is ignored.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Sep 1 '06 #3
"Dave" <da**@seafaretech.co.ukwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Hi,

I've been trawling the web for answer to my problem with no luck
although I'm hardly alone it seems!

Below is the generated source for an ASP page that posts a value called
'album' to another ASP page. The other page retrieves the value with
Request.Form('album'); On Firefox this works fine every time. On IE6, I
always get nothing. I'm pretty sure it's the posting side that is at
fault, so that's what I've shown here. Oh, I tried Request.QueryString
too and again, fine on Firefox, nothing on IE6.

Any help would be much appreciated.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>Gallery</title>
<!--mstheme-->
<link rel="stylesheet" type="text/css"
href="_themes/poetic2/poet1011.css">
<meta name="Microsoft Theme" content="poetic2 1011, default">
</head>
<body>
<form name='albumselect' action="gallery_intro.asp" method="post"
target="intro">
<CENTER><h2>ALBUMS</h2></CENTER><hr><br>
<CENTER><input name='album' type=image src='photogallery/Test
One/Title.jpg' value='photogallery/Test One'
onClick='submit();'></CENTER>
<CENTER>Test One Photos</CENTER><br><hr><br>
<CENTER><input name='album' type=image src='photogallery/Test
Two/Title.jpg' value='photogallery/Test Two'
onClick='submit();'></CENTER>
<CENTER>Test Two Photos</CENTER><br><hr><br>
<CENTER><input name='album' type=image src='photogallery/Test
Three/Title.jpg' value='photogallery/Test Three'
onClick='submit();'></CENTER>
<CENTER>Test Three Photos</CENTER><br><hr><br>
</form>
</body>
</html>
Strip it down and you have:
<input name='album' type=image
three times!

Which is your
Request.Form('album');
supposed to reference?

Of course, were seeing the generated code not the ASP page...

Strip the calling and called pages down to the minimum
then test them; if there's still a problem then post them.
Sep 1 '06 #4
Hi Ray,

Thanks for responding. The ASP is below. As another exercise I did a
view source from both firefox and IE6 to compare them. Whether this is
merely a difference in the two "view source" implementations I don't
know but in the Firefox one, the single quotes around 'album' had been
changed to double quotes ("album") and the strings for img src had been
'translated', ie the spaces changed to %20.

eg: Firefox says:

<center><input name="album" src="photogallery/Test%20One/Title.jpg"
value="photogallery/Test One" onclick="submit();"
type="image"></center>

but IE6 says:

<center><input name='album' src='photogallery/Test One/Title.jpg'
value='photogallery/Test One' onclick=submit();' type='image'></center>

Probably a red herring but I thought I'd mention it.

The ASP code for this is:

------------------------------------------------------------------
<%@ Language=JavaScript %>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>Gallery</title>
<meta name="Microsoft Theme" content="poetic2 1011, default">
</head>

<body>

<form name='albumselect' action="gallery_intro.asp" method="post"
target="intro">
<CENTER><h2>ALBUMS</h2></CENTER><hr><br>

<SCRIPT LANGUAGE="JavaScript" RUNAT="Server">

var fso, f, fc, fs, so, tl;
var fullpath, fsr;

fso = new ActiveXObject("Scripting.FileSystemObject");

fullpath = Server.MapPath("photogallery");

f = fso.GetFolder(fullpath);
fc = new Enumerator(f.SubFolders);

for (; !fc.atEnd(); fc.moveNext())
{
fs = fc.item().Path;
so = fso.OpenTextFile(fs + "/Title.txt", 1, 0);
tl = so.ReadLine();
so.Close();

fs = fc.item().Name;
fsr = "photogallery/" + fs.toString();
Response.Write("<CENTER><input name='album' type=image src='" + fsr +
"/Title.jpg' value='" + fsr + "' onClick='submit();'></CENTER>");
Response.Write("<CENTER>" + tl + "</CENTER><br><hr><br>");
}

Response.Write("</form></body></html>");

</SCRIPT>
------------------------------------------------------------------

I'm now really hoping you look at this and go "Ah Ha!!!".

As for the submit(): According to my documentation, its required to
make the form submit when you click the pic. Perhaps it one of those
optional bits.

Dave

Ray Costanzo [MVP] wrote:
Can you give your ASP code? Also, what's "submit()?" An <input
type="image"will submit the form when clicked already.

Ray at work
Sep 1 '06 #5
I've posted the ASP now. I tried it with just one entry instead of
three. Same problem.

With Firefox, the Request.Form correctly references the instance of
'album' that was clicked.

Thanks for the thought though.

Dave

McKirahan wrote:
Strip it down and you have:
<input name='album' type=image
three times!

Which is your
Request.Form('album');
supposed to reference?

Of course, were seeing the generated code not the ASP page...

Strip the calling and called pages down to the minimum
then test them; if there's still a problem then post them.
Sep 1 '06 #6
Dave wrote:
On Firefox this works fine every time. On IE6, I always
get nothing.

<input name='album' type=image ...>
If you simply tried this, you would understand the issue entirely:

Response.Write(Request.Form)

In short, INPUT TYPE="image" elements send .x and .y values. According to
MSDN, VALUE is not a valid property of this element:

http://msdn.microsoft.com/workshop/a...nput_image.asp
http://msdn.microsoft.com/workshop/a...es/value_1.asp

This appears to conflict somewhat with the HTML specification:
http://www.w3.org/TR/html401/interac...ef-value-INPUT

If you want to know which image input was clicked, you need unique names,
and then you can do this:

JScript:
if (Request.Form("input_name.x").Count) ...

vbscript:
If Request.Form("input_name.x").Count 0 Then ...

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Sep 1 '06 #7
"Dave" <da**@seafaretech.co.ukwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
I've posted the ASP now.
[snip]

Where?
Sep 1 '06 #8
I wrote:
According to MSDN, VALUE is not a valid property of this element:

http://msdn.microsoft.com/workshop/a...nput_image.asp
http://msdn.microsoft.com/workshop/a...es/value_1.asp

This appears to conflict somewhat with the HTML specification:
http://www.w3.org/TR/html401/interac...ef-value-INPUT
I should add that this behavior (not sending the name-value pair) remains
the same under IE7.

And to clarify my comment about a conflict with the specification, I think
Microsoft and Mozilla interpret the recommendation differently. There is
wriggle room, too, since the recommendation does not define image controls
as Control Types, which directly refutes the notion that they could be
Successful Controls:

http://www.w3.org/TR/html401/interac....html#h-17.2.1
http://www.w3.org/TR/html401/interac...html#h-17.13.2
FWIW, Opera behaves like IE on this matter.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Sep 1 '06 #9
Mr Anderson, you're a star. Many many thanks.

Dave

Dave Anderson wrote:
I wrote:
According to MSDN, VALUE is not a valid property of this element:

http://msdn.microsoft.com/workshop/a...nput_image.asp
http://msdn.microsoft.com/workshop/a...es/value_1.asp

This appears to conflict somewhat with the HTML specification:
http://www.w3.org/TR/html401/interac...ef-value-INPUT

I should add that this behavior (not sending the name-value pair) remains
the same under IE7.

And to clarify my comment about a conflict with the specification, I think
Microsoft and Mozilla interpret the recommendation differently. There is
wriggle room, too, since the recommendation does not define image controls
as Control Types, which directly refutes the notion that they could be
Successful Controls:

http://www.w3.org/TR/html401/interac....html#h-17.2.1
http://www.w3.org/TR/html401/interac...html#h-17.13.2
FWIW, Opera behaves like IE on this matter.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Sep 1 '06 #10

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

Similar topics

1
by: Ralph Freshour | last post by:
I have two dropdown list: frm_cbo_top frm_cbo_bottom I have an OnChange="submit_form();" in each of these dropdown lists - the javascript does a form.submit() call
3
by: NotGiven | last post by:
Page1 has a form that calls Page2. The beginning of Page2: <? php session_start(); $s=$_POST; session_register("s"); ?> in the middle of Page2 I have a form varaible: <?php echo $_POST; ?>...
12
by: Matthew Crouch | last post by:
Please give this code a look. I'm not a JS programmer at all, but I can't figure out why identical lines in essentially the same context work in one place but in the other, it causes the entire...
4
by: liizuka | last post by:
Hi... I have a problem with request.form and noticed that it works fine if the action references the localstart.asp page. It doesn't work if it references any other page. Even with a pretty simple...
1
by: Samuel | last post by:
Why my Crystal Report form works on the machine I installed VB.NET, not works on the machine without VB.NET? Thanks.
3
by: Bob | last post by:
I've got a fair amount of Javascript coding that works great in IE and Opera, but is completely ignore in Firefox and Netscape. See: www.bridgemate.net/BeachWatchers/Regis.htm Right after the...
0
by: Mark Sandfox | last post by:
I have a simply email form using smtpmail.send. This form works on 99% of computers but does not work on my customers computer. He gets the generic runtime error. Again when tested on every...
3
by: xred11 | last post by:
Hi, Just switched to a new server, code work fine for 2 years, now on Win2003sp2, OK in IE6, Firefox, but ONLY 1 of 2 IE7's. One works, one doesn't. Fussed for a long time - boils down to this- ...
2
by: bredsblocker09 | last post by:
i have created this upload form that will upload an image file... this works fine in both IE and firefox. I then created an identical form that will upload mp3 files. however this will work in IE but...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...
0
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,...
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
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,...
0
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...

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.