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

how to use Request.Form("fieldname")?

Hi,

I was experimenting with some basic sample asp code but can't get it to work
correctly:

this is bgselector.asp which works OK - you add the name of a basic color
like blue, green, yellow and call another asp called backcolor.asp where I
have the problem:

bgselector.asp
---------------------------------
<html>
<head>
<title>Test page</title>
</head>
<body>
form>
Background Color selector
<form action ="backcolor.asp" method="post">
Please type in a valid color e.g blue , green , yellow
<input type="text" name ="backcolor"><p>
<input type="submit" value="submit"><p>
</form>
</body>
</html>
--------------------------------------------

in backcolor.asp the code that uses the color from bgselector.asp is
<%
Dim strBackColor
strBackColor = Request.Form("backcolor")
%>

How do I implement this? Here is what I tried that did not work to change
the backcolor of backcolor.asp

<html>
<head>
<title>backcolor</title>
<%
Dim strBackColor
strBackColor = Request.Form("backcolor")
%>
</head>
<body bgcolor=<%strBackcolor%>>

</body>
</html>

Any suggestions appreciated.
Thanks,
Rich
Mar 23 '06 #1
7 1928
I figured this out:

<html>
<head>
<title>backcolor</title>
<%
Dim strBackColor
strBackColor = Request.Form("backcolor")
%>
</head>
<body bgcolor=<% response.write strBackColor%>>

</body>
</html

I forgot about <%response.write strBackColor%>
"Rich" wrote:
Hi,

I was experimenting with some basic sample asp code but can't get it to work
correctly:

this is bgselector.asp which works OK - you add the name of a basic color
like blue, green, yellow and call another asp called backcolor.asp where I
have the problem:

bgselector.asp
---------------------------------
<html>
<head>
<title>Test page</title>
</head>
<body>
form>
Background Color selector
<form action ="backcolor.asp" method="post">
Please type in a valid color e.g blue , green , yellow
<input type="text" name ="backcolor"><p>
<input type="submit" value="submit"><p>
</form>
</body>
</html>
--------------------------------------------

in backcolor.asp the code that uses the color from bgselector.asp is
<%
Dim strBackColor
strBackColor = Request.Form("backcolor")
%>

How do I implement this? Here is what I tried that did not work to change
the backcolor of backcolor.asp

<html>
<head>
<title>backcolor</title>
<%
Dim strBackColor
strBackColor = Request.Form("backcolor")
%>
</head>
<body bgcolor=<%strBackcolor%>>

</body>
</html>

Any suggestions appreciated.
Thanks,
Rich

Mar 23 '06 #2
=?Utf-8?B?UmljaA==?= wrote on 23 mrt 2006 in
microsoft.public.inetserver.asp.general:
<%
Dim strBackColor
strBackColor = Request.Form("backcolor")
%>
</head>
<body bgcolor=<%strBackcolor%>>
<body bgcolor='<% = strBackcolor %>' >



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 23 '06 #3
You might also use
<body bgcolor=<%=strBackcolor%>>

"Rich" <Ri**@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
I figured this out:

<html>
<head>
<title>backcolor</title>
<%
Dim strBackColor
strBackColor = Request.Form("backcolor")
%>
</head>
<body bgcolor=<% response.write strBackColor%>>

</body>
</html

I forgot about <%response.write strBackColor%>
"Rich" wrote:
Hi,

I was experimenting with some basic sample asp code but can't get it to
work
correctly:

this is bgselector.asp which works OK - you add the name of a basic color
like blue, green, yellow and call another asp called backcolor.asp where
I
have the problem:

bgselector.asp
---------------------------------
<html>
<head>
<title>Test page</title>
</head>
<body>
form>
Background Color selector
<form action ="backcolor.asp" method="post">
Please type in a valid color e.g blue , green , yellow
<input type="text" name ="backcolor"><p>
<input type="submit" value="submit"><p>
</form>
</body>
</html>
--------------------------------------------

in backcolor.asp the code that uses the color from bgselector.asp is
<%
Dim strBackColor
strBackColor = Request.Form("backcolor")
%>

How do I implement this? Here is what I tried that did not work to
change
the backcolor of backcolor.asp

<html>
<head>
<title>backcolor</title>
<%
Dim strBackColor
strBackColor = Request.Form("backcolor")
%>
</head>
<body bgcolor=<%strBackcolor%>>

</body>
</html>

Any suggestions appreciated.
Thanks,
Rich

Mar 23 '06 #4
even <body bgcolor=<%=strBackColor%>> works.

Mar 24 '06 #5
Or even:

<html>
<head>
<title>backcolor</title>
</head>
<body bgcolor=<% =Request.Form("backcolor")%>>

--
Mike Brind
John Kotuby wrote:
You might also use
<body bgcolor=<%=strBackcolor%>>

"Rich" <Ri**@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
I figured this out:

<html>
<head>
<title>backcolor</title>
<%
Dim strBackColor
strBackColor = Request.Form("backcolor")
%>
</head>
<body bgcolor=<% response.write strBackColor%>>

</body>
</html

I forgot about <%response.write strBackColor%>
"Rich" wrote:
Hi,

I was experimenting with some basic sample asp code but can't get it to
work
correctly:

this is bgselector.asp which works OK - you add the name of a basic color
like blue, green, yellow and call another asp called backcolor.asp where
I
have the problem:

bgselector.asp
---------------------------------
<html>
<head>
<title>Test page</title>
</head>
<body>
form>
Background Color selector
<form action ="backcolor.asp" method="post">
Please type in a valid color e.g blue , green , yellow
<input type="text" name ="backcolor"><p>
<input type="submit" value="submit"><p>
</form>
</body>
</html>
--------------------------------------------

in backcolor.asp the code that uses the color from bgselector.asp is
<%
Dim strBackColor
strBackColor = Request.Form("backcolor")
%>

How do I implement this? Here is what I tried that did not work to
change
the backcolor of backcolor.asp

<html>
<head>
<title>backcolor</title>
<%
Dim strBackColor
strBackColor = Request.Form("backcolor")
%>
</head>
<body bgcolor=<%strBackcolor%>>

</body>
</html>

Any suggestions appreciated.
Thanks,
Rich


Mar 24 '06 #6
ravichoudhari wrote on 24 mrt 2006 in
microsoft.public.inetserver.asp.general:
even <body bgcolor=<%=strBackColor%>> works.


Certainly, but to keep you straight for other insertions, that could have
spaces in the string, I suggest you always clientside quote the string:

<body bgcolor='<%=strBackColor%>'>

=========

btw, better use css styles:

<body style='background-color:<%=strBackColor%>;'>

or even more versatile:

<style>
body {background-color:<% = request.form("BackColor") %>;
color:<% = request.form("TextColor") %>;font-weight:600;}
</style>
</head>
<body>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 24 '06 #7

"John Kotuby" <jo***@powerlist.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
You might also use
<body bgcolor=<%=strBackcolor%>>
quite right,

but you should alos enclose it quotes incase the vaiable is "two words"

<body bgcolor="<%=strBackcolor%>" >


"Rich" <Ri**@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
I figured this out:

<html>
<head>
<title>backcolor</title>
<%
Dim strBackColor
strBackColor = Request.Form("backcolor")
%>
</head>
<body bgcolor=<% response.write strBackColor%>>

</body>
</html

I forgot about <%response.write strBackColor%>
"Rich" wrote:
Hi,

I was experimenting with some basic sample asp code but can't get it to
work
correctly:

this is bgselector.asp which works OK - you add the name of a basic
color
like blue, green, yellow and call another asp called backcolor.asp where
I
have the problem:

bgselector.asp
---------------------------------
<html>
<head>
<title>Test page</title>
</head>
<body>
form>
Background Color selector
<form action ="backcolor.asp" method="post">
Please type in a valid color e.g blue , green , yellow
<input type="text" name ="backcolor"><p>
<input type="submit" value="submit"><p>
</form>
</body>
</html>
--------------------------------------------

in backcolor.asp the code that uses the color from bgselector.asp is
<%
Dim strBackColor
strBackColor = Request.Form("backcolor")
%>

How do I implement this? Here is what I tried that did not work to
change
the backcolor of backcolor.asp

<html>
<head>
<title>backcolor</title>
<%
Dim strBackColor
strBackColor = Request.Form("backcolor")
%>
</head>
<body bgcolor=<%strBackcolor%>>

</body>
</html>

Any suggestions appreciated.
Thanks,
Rich


Mar 24 '06 #8

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

Similar topics

3
by: F. Da Costa | last post by:
Hi, I was wondering *why* there is a difference between the results of the following two statements. On the suface they seem to do the same (or do they?) frm => returns void ...
3
by: MLH | last post by:
I have a block of text with about 19,000 characters - alphanumeric, punctuation, hard returns, etc... I would like to count the number of periods ( Chr$(46) ) appearing in the document. Whats a...
2
by: crjunk | last post by:
I'm trying to write a piece of code that will programatically save a record automatically without me having to add a new ' Row.Item("ADD1") = txtAdd1.Text.Trim.ToUpper ' type command each time I...
1
by: Abe Simpson | last post by:
Hi all, My form file has this attribute: <META http-equiv="Content-Type" content="text/html; charset=utf-8"> The form's action points to an .aspx file where I try to retrieve field values...
4
by: mosscliffe | last post by:
I have been messing with the above all afternoon. I must just be thick I am using an AccessDataSource I have tried modifying the select but I can not find the right syntax to concatenate...
7
by: Brave | last post by:
I am hoping for a code example of how to do this, and hopefully it will help me to see an easy way to code what seems to be a huge monster. I need to create a form that has two pulldown menues...
1
by: hifiger2004 | last post by:
Hi Everyone, I have a problem with my classic asp programming. I think I missed something. I encountered logical error an hour ago. And below is one of the lines in my source code wherein I...
1
by: technod | last post by:
Hi, The error I am describing occurs with the script I've pasted below. It's a validator for form fields and prints a message into a span tag located beside the empty input tag. I have hard...
2
by: Peter Laman | last post by:
In my app I need to dynamically generate a series hyperlinks. Each hyperlink's action must be to focus a field in a <form>. I created the following function to create such a link (the argument is a...
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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
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...
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,...

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.