Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Pass hidden form field value to another form field to insert in db

Reply
Thread Tools

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

 
 
GavMc
Guest
Posts: n/a
 
      09-22-2005
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">
 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      09-22-2005
=?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)

 
Reply With Quote
 
 
 
 
GavMc
Guest
Posts: n/a
 
      09-22-2005
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)
>
>

 
Reply With Quote
 
CJM
Guest
Posts: n/a
 
      09-22-2005
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?


 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      09-22-2005
=?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)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript validation for a not required field, field is onlyrequired if another field has a value jr Javascript 3 07-08-2010 10:33 AM
Populate Hidden field on post back and retrieve value from Hidden Field Rick ASP .Net 3 04-13-2010 05:38 PM
How to pass the hidden field's value within the context of iframe? AwefulService@gmail.com Javascript 1 03-16-2008 12:25 AM
Pass multiple email addresses to a hidden field in a form james00_c@yahoo.com Javascript 1 06-21-2005 05:10 AM
ADSI/ASP: How to pass distinguishedName as hidden form field? Bharat Suneja ASP General 0 09-10-2004 03:41 PM



Advertisments