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

G

GavMc

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">
 
E

Evertjan.

=?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]
 
G

GavMc

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. said:
=?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">
 
C

CJM

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?
 
E

Evertjan.

=?Utf-8?B?R2F2TWM=?= wrote on 22 sep 2005 in
microsoft.public.inetserver.asp.general:
[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)
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top