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

Discussion in 'ASP General' started by News Groups, Aug 11, 2004.

  1. News Groups

    News Groups Guest

    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
    News Groups, Aug 11, 2004
    #1
    1. Advertising

  2. News Groups

    Ray at Guest

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

    Ray at work

    "News Groups" <> wrote in message
    news:...
    > 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
    >
    >
    >
    Ray at, Aug 11, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    1,140
    David Wier
    Aug 5, 2005
  2. Gnarlodious
    Replies:
    4
    Views:
    17,556
    elizas
    May 5, 2010
  3. Stephan Steiner
    Replies:
    1
    Views:
    346
    bruce barker
    Sep 24, 2009
  4. Bill
    Replies:
    2
    Views:
    111
    Andrew Durstewitz
    Jul 9, 2003
  5. Rizyak
    Replies:
    4
    Views:
    161
    Rizyak
    Jun 11, 2004
Loading...

Share This Page