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.

Photo

Combining 2 variables in a ASP Form


  • Please log in to reply
3 replies to this topic

#1 deloa2

deloa2

  • Members
  • 8 posts
  • OFFLINE
  •  
  • Local time:11:31 PM

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)%>">

BC AdBot (Login to Remove)

 


#2 HuckerJ

HuckerJ

  • Members
  • 189 posts
  • OFFLINE
  •  
  • Location:East Tennessee
  • Local time:12:31 AM

Posted 06 August 2004 - 05:50 AM

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

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 deloa2

deloa2
  • Topic Starter

  • Members
  • 8 posts
  • OFFLINE
  •  
  • Local time:11:31 PM

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 HuckerJ

HuckerJ

  • Members
  • 189 posts
  • OFFLINE
  •  
  • Location:East Tennessee
  • Local time:12:31 AM

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

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!!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users