473,903 Members | 5,705 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to use Request.Form("f ieldname")?

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("b ackcolor")
%>

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

<html>
<head>
<title>backcolo r</title>
<%
Dim strBackColor
strBackColor = Request.Form("b ackcolor")
%>
</head>
<body bgcolor=<%strBa ckcolor%>>

</body>
</html>

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

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

</body>
</html

I forgot about <%response.writ e 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("b ackcolor")
%>

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

<html>
<head>
<title>backcolo r</title>
<%
Dim strBackColor
strBackColor = Request.Form("b ackcolor")
%>
</head>
<body bgcolor=<%strBa ckcolor%>>

</body>
</html>

Any suggestions appreciated.
Thanks,
Rich

Mar 23 '06 #2
=?Utf-8?B?UmljaA==?= wrote on 23 mrt 2006 in
microsoft.publi c.inetserver.as p.general:
<%
Dim strBackColor
strBackColor = Request.Form("b ackcolor")
%>
</head>
<body bgcolor=<%strBa ckcolor%>>
<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=<%=strB ackcolor%>>

"Rich" <Ri**@discussio ns.microsoft.co m> wrote in message
news:05******** *************** ***********@mic rosoft.com...
I figured this out:

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

</body>
</html

I forgot about <%response.writ e 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("b ackcolor")
%>

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

<html>
<head>
<title>backcolo r</title>
<%
Dim strBackColor
strBackColor = Request.Form("b ackcolor")
%>
</head>
<body bgcolor=<%strBa ckcolor%>>

</body>
</html>

Any suggestions appreciated.
Thanks,
Rich

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

Mar 24 '06 #5
Or even:

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

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

"Rich" <Ri**@discussio ns.microsoft.co m> wrote in message
news:05******** *************** ***********@mic rosoft.com...
I figured this out:

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

</body>
</html

I forgot about <%response.writ e 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("b ackcolor")
%>

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

<html>
<head>
<title>backcolo r</title>
<%
Dim strBackColor
strBackColor = Request.Form("b ackcolor")
%>
</head>
<body bgcolor=<%strBa ckcolor%>>

</body>
</html>

Any suggestions appreciated.
Thanks,
Rich


Mar 24 '06 #6
ravichoudhari wrote on 24 mrt 2006 in
microsoft.publi c.inetserver.as p.general:
even <body bgcolor=<%=strB ackColor%>> 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='<%=str BackColor%>'>

=========

btw, better use css styles:

<body style='backgrou nd-color:<%=strBac kColor%>;'>

or even more versatile:

<style>
body {background-color:<% = request.form("B ackColor") %>;
color:<% = request.form("T extColor") %>;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***@powerlis t.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
You might also use
<body bgcolor=<%=strB ackcolor%>>
quite right,

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

<body bgcolor="<%=str Backcolor%>" >


"Rich" <Ri**@discussio ns.microsoft.co m> wrote in message
news:05******** *************** ***********@mic rosoft.com...
I figured this out:

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

</body>
</html

I forgot about <%response.writ e 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("b ackcolor")
%>

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

<html>
<head>
<title>backcolo r</title>
<%
Dim strBackColor
strBackColor = Request.Form("b ackcolor")
%>
</head>
<body bgcolor=<%strBa ckcolor%>>

</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
1835
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 frm.getAttribute("custom") => returns the value of the attribute
3
2002
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 good little code snippet to do something like that? xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2
2884
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 add a new textbox. I've named all my textboxes in the following format txtAdd1 and I've named all my field in the SQL table the same way minus the txt at the beginning. This code scans the form for textboxes. If it finds a text box that is not...
1
2186
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 as follows: txtTextBox.Text = Request;
4
1961
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 the LIKE part of the test by surrounding my textbox field value with a leading and closing %.
7
2432
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 (field names Option1 and Option2). Each will house a list of the 50 U.S. States. Users would then be able to choose two states, and get a listing for a courier used for pickup\deliveries (exp: My order is in Ohio, but I need it delivered to Maine....
1
1797
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 encountered error. As looking on the code below, I don't know if what was lacking, because it won't satisfy the condition, and it won't go to the next line "SaveRecord". I am actually generating a checkboxes, dynamically and the checkboxes are based...
1
2631
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 coded the error message to be printed in a specific span tag for testing. --> "<span id="name">www</span>" When this span tag is positioned BEFORE the input tag it works fine but when I place it after (which is the layout I want) it stops working...
2
2022
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 field object, e.g. <input>): function createFieldAnchor(field, linkText) { var anchor = document.createElement("a"); anchor.field = field; anchor.href='javascript:this.focusField()';
0
9999
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9847
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,...
1
10986
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
10501
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9685
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8049
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5894
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...
1
4727
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
4308
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.