Assigning 2 variables from a single form select input

D

Dave Lagergren

I need to assign input from a drop down box to two different variables. Code
is presently something like:

<p><font face="Arial"> CC for Billing: <input type="text" name="CC"
size="20">
Type: <select size="1" name="CC_Type">
<option>Master Card</option>
<option>Visa</option>
<option>Discover</option>
<option>AMEX</option>
</select>

I need to assign the selection to the variable "Method" as well.
 
T

Thomas A. Rowe

On the post page grab the variable

Classic ASP/VBScript:
<%
Method = Request.Form("CC_Type")
%>

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
D

Dave Lagergren

Thank you for the feedback. I really appreciate the help.

I'm not positive I explained everything correctly. The form on the page
submits to itself (<form method="POST" action="--WEBBOT-SELF--" onSubmit="">)

I have three variables that are assigned by the program, not the user. I am
using the snipet below to try and pass them back:

<%
Processor = Request.Form("Rep")
%>

<input type="hidden" name="OrderNumber" value= <% =iRecordCount%>>
<input type="hidden" name="Status" value="Submitted">
<input type="hidden" name="Processor" value=<% =Processor%>>

The first two work (OrderNumber and Status) and are saved in the database.
Processor doesn't. I have verified that the database is set up correctly.
If I hard code in <input type="hidden" name="Processor" value="Eddie"> it
works fine. Somehow I am missing how to pass the variable. I have tried a
number of formats for the value of Processor including Request.Form, ="Rep",
=Request.Form("Rep")...

All three values need to be saves to the database. I have an additional 112
fields saved as well (it's part of a complex order form).
 
T

Thomas A. Rowe

First,

Make the following correction:

<input type="hidden" name="OrderNumber" value="<%=iRecordCount%>">
<input type="hidden" name="Status" value="Submitted">
<input type="hidden" name="Processor" value="<%=Processor%>">
<input type="hidden" name="Method" value="<%=Method%>">


Then you can either do like above with,
<%
Processor = Request.Form("Rep")
Method = Request.Form("CC_Type")
%>

or

<input type="hidden" name="OrderNumber" value="<% =iRecordCount%>">
<input type="hidden" name="Status" value="Submitted">
<input type="hidden" name="Processor" value="<% =Request.Form("Rep")%>">
<input type="hidden" name="Method" value="<%=Request.Form("CC_Type")%>">

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
D

Dave Lagergren

Thomas- For some reason it doesn't work. I finally (temporarily) set the
"Status" and "OrderNumber" variables as session variables and that works but
they are not input by the user and I kept them as input type hidden as well.
This way they are available to the confirmation.asp program and write to the
database. However the I cannot assign the "Rep" variable to Processor and
get it to get written to the database.

All the database activity is within DRW if that makes a difference. I am
almost ready to re-write everything by hand!
 
T

Thomas A. Rowe

Personally, I would re-write everything by hand.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
D

Dave Lagergren

Thanks. That's what I thought. If I hadn't been in such a hurry I would
have been wiser to have started that way. :)

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top