How to access variables (form text box values) on same form?

N

News Groups

Hello Asp Programmers,

I have a question. I have a form on an ASP page that has 5 text boxes, for
data
entry. I am trying to get data from the text box, and pass it to a hidden
text box on the form.

The hidden text box is called "MyDateTime" (a SQL date and time value).

I am attempting to concatenate data from two other textboxes (one for date
and one for time) to give a string like : "8/8/2004 8:00 AM"
I am trying to use the following:

<% Dim time
Dim date
Dim dateAndTime

time = Request.Form("usertime")
date = Request.Form("userdate")
dateAndTime = FormatDateTime(time & " " & date,vbGeneralDate)

in the html for MyDateTime hidden field i use this: value=
"<%=dateAndTime%>

for some reason the time and date fields, do not have data in them (although
typed on form)

I want to use data typed in the text boxes including the dateAndTime value
and insert those values in a database.

What am I not doing here??

Thanks for your help (previous posts answered and provided fixes for me)

eric
 
R

Ray at

You are attempting to run this code AFTER the form is submitted, correct?

Ray at work
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top