BleepingComputer.com: Combining 2 variables in a ASP Form

Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Combining 2 variables in a ASP Form Credit Card expdate

#1 User is offline   deloa2 

  • New Member
  • Pip
  • Find Topics
  • Group: Members
  • Posts: 8
  • Joined: 12-July 04

Posted 06 August 2004 - 02:02 AM

I need in to post a variable EXPDATE (in the format "mmyyyy") that is composed out of two variables captured through a SELECT/OPTION tags. One is for the month and the other one for the year.

Your help wil be appreciated!

This is my code that goes inside my Form:

<select name="Month">
<OPTION value="" selected>Month</OPTION>
<OPTION value="1">Jan</OPTION>
<OPTION value="2">Feb</OPTION>
...
<OPTION value="11">Nov</OPTION>
<OPTION value="12">Dec</OPTION>
</SELECT>
&nbsp;/&nbsp;
<select name="Year">
<OPTION value="" selected>Year</OPTION>
<OPTION value="<%response.write(Year(date()))%>">="<%response.write(Year(date()))%></OPTION>
<OPTION value="<%response.write(Year(date())+1)%>"><%response.write(Year(date())+1)%></OPTION>
<OPTION value="<%response.write(Year(date())+2)%>"><%response.write(Year(date())+2)%></OPTION>
<OPTION value="<%response.write(Year(date())+3)%>"><%response.write(Year(date())+3)%></OPTION>
</SELECT>
<%
xExpdate = MonthYear '----This doesn't sound right(?)
%>
<input type="hidden" name="EXPDATE" value="<%response.write(xExpdate)%>">

#2 User is offline   HuckerJ 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 189
  • Joined: 11-April 04
  • Location:East Tennessee

Posted 06 August 2004 - 05:50 AM

Doesn't ASP use ampersands to concatenate?
<%
xExpdate = Month & Year
%>

This post has been edited by HuckerJ: 06 August 2004 - 05:52 AM

There are 10 kinds of people. Those who understand binary notation, and those who do not.
Posted Image - It plays, it streams, it kills WiMPs!!

#3 User is offline   deloa2 

  • New Member
  • Pip
  • Find Topics
  • Group: Members
  • Posts: 8
  • Joined: 12-July 04

Posted 06 August 2004 - 01:03 PM

Unfortunatelly your option didn't work.

When you submit the form, the values for month and year are submitted directly without asigning the value for EXPDATE. Therefore EXPDATE goes null

Please any other options?

Thx!

#4 User is offline   HuckerJ 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 189
  • Joined: 11-April 04
  • Location:East Tennessee

Posted 07 August 2004 - 08:53 AM

I see.... :thumbsup:
Try this:
dim 1, 2, xExpdate : 1 = request("month") : 2 = request("year") : xExpdate = 1 & 2

This post has been edited by HuckerJ: 07 August 2004 - 08:56 AM

There are 10 kinds of people. Those who understand binary notation, and those who do not.
Posted Image - It plays, it streams, it kills WiMPs!!

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users