Pass hidden form field value to another form field to insert in db

Discussion in 'ASP General' started by GavMc, Sep 22, 2005.

  1. GavMc

    GavMc Guest

    Hello I am new to internet programming and wonder if anyone can help me with
    this....

    I am trying to pass a hidden field value on a form into another field on the
    form so that it can then be inserted in the database, to enable me then to
    reference that number at a later date.

    (The hidden value (1 for example) would then automatically get passed to the
    other input field.)

    The code for the text field that allows users to type an number into it for
    submission to the db is below, but what code do i need within the hidden
    field to populate this text field below so that users do not have to type the
    number in?

    Any help would be appreciated.

    G.

    <INPUT TYPE="text" NAME="ItemName1"
    VALUE="<% If Not blnNew Then Response.Write rsItem("ItemName") End
    If%>"
    SIZE="40" MAXLENGTH="75">
    GavMc, Sep 22, 2005
    #1
    1. Advertising

  2. GavMc

    Evertjan. Guest

    =?Utf-8?B?R2F2TWM=?= wrote on 22 sep 2005 in
    microsoft.public.inetserver.asp.general:

    > Hello I am new to internet programming and wonder if anyone can help
    > me with this....
    >
    > I am trying to pass a hidden field value on a form into another field
    > on the form so that it can then be inserted in the database, to enable
    > me then to reference that number at a later date.
    >
    > (The hidden value (1 for example) would then automatically get passed
    > to the other input field.)
    >
    > The code for the text field that allows users to type an number into
    > it for submission to the db is below, but what code do i need within
    > the hidden field to populate this text field below so that users do
    > not have to type the number in?
    >
    > Any help would be appreciated.


    What you ask seems to be clientside, so OT on this serverside NG.

    Serverside you don't need a hidden field. Just programm what you want.


    > <INPUT TYPE="text" NAME="ItemName1"
    > VALUE="<% If Not blnNew Then Response.Write
    > rsItem("ItemName") End If%>"


    This can be done,
    but if this is an oneline if-then should not have an End If
    [However ASP-vbs has a bug that allows it]

    > SIZE="40" MAXLENGTH="75">





    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
    Evertjan., Sep 22, 2005
    #2
    1. Advertising

  3. GavMc

    GavMc Guest

    Re: Pass hidden form field value to another form field to insert i

    The code i am using currently on the site works. But i dont want users to
    have to type anything in the field, that is why i want to use a hidden field
    that fills the form field to then submit it to the database

    "Evertjan." wrote:

    > =?Utf-8?B?R2F2TWM=?= wrote on 22 sep 2005 in
    > microsoft.public.inetserver.asp.general:
    >
    > > Hello I am new to internet programming and wonder if anyone can help
    > > me with this....
    > >
    > > I am trying to pass a hidden field value on a form into another field
    > > on the form so that it can then be inserted in the database, to enable
    > > me then to reference that number at a later date.
    > >
    > > (The hidden value (1 for example) would then automatically get passed
    > > to the other input field.)
    > >
    > > The code for the text field that allows users to type an number into
    > > it for submission to the db is below, but what code do i need within
    > > the hidden field to populate this text field below so that users do
    > > not have to type the number in?
    > >
    > > Any help would be appreciated.

    >
    > What you ask seems to be clientside, so OT on this serverside NG.
    >
    > Serverside you don't need a hidden field. Just programm what you want.
    >
    >
    > > <INPUT TYPE="text" NAME="ItemName1"
    > > VALUE="<% If Not blnNew Then Response.Write
    > > rsItem("ItemName") End If%>"

    >
    > This can be done,
    > but if this is an oneline if-then should not have an End If
    > [However ASP-vbs has a bug that allows it]
    >
    > > SIZE="40" MAXLENGTH="75">

    >
    >
    >
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Replace all crosses with dots in my emailaddress)
    >
    >
    GavMc, Sep 22, 2005
    #3
  4. GavMc

    CJM Guest

    Re: Pass hidden form field value to another form field to insert i

    Why have a field that does nothing - ie you dont want the user to enter
    anything into the field?

    If you are meaning that you want to use the value in the hidden field if the
    user chooses not to enter a value in the visible field then you just need to
    pick this up when you process the form (post-submission)...

    Or am I misunderstanding you?
    CJM, Sep 22, 2005
    #4
  5. GavMc

    Evertjan. Guest

    Re: Pass hidden form field value to another form field to insert i

    =?Utf-8?B?R2F2TWM=?= wrote on 22 sep 2005 in
    microsoft.public.inetserver.asp.general:
    > "Evertjan." wrote:
    >>
    >> What you ask seems to be clientside, so OT on this serverside NG.


    [please do not toppost on usenet]

    > The code i am using currently on the site works. But i dont want users
    > to have to type anything in the field, that is why i want to use a
    > hidden field that fills the form field to then submit it to the
    > database


    This is not useful.

    The information exists on the server,
    so why send it hidden to the client to get it back?

    Keep it on the server in a session variable,
    and on submit, send it to the database.

    -
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
    Evertjan., Sep 22, 2005
    #5
    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. Rick
    Replies:
    3
    Views:
    8,146
    Alexey Smirnov
    Apr 13, 2010
  2. Bharat Suneja
    Replies:
    0
    Views:
    216
    Bharat Suneja
    Sep 10, 2004
  3. Replies:
    1
    Views:
    261
  4. Replies:
    1
    Views:
    371
    Don Li
    Mar 16, 2008
  5. jr
    Replies:
    3
    Views:
    417
Loading...

Share This Page