Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inseting an id as hidden field - Urgent, please!

Status
Not open for further replies.

chinedu

Technical User
Mar 7, 2002
241
US
How can I pass a hidden id into a form and insert this form into the db?
For instance, if an Id is created and stored into a table and I want this id to be picked up and inserted into another table.
Sometimes a manual id is inserted into the db.
Basically, some numbers get inserted manually while some are inserted by selecting the id from another table.
How can I do this without duplicating ids.
I have added a trigger that says if number is duplicate, raise an error.
I am afraid this will anger the users.
Please advise.
 
Hi,
In forms ,we have provision for hidden fields which is specified as
<INPUT TYPE =&quot;HIDDEN&quot; NAME=&quot;ITRON&quot; VALUE=&quot;ID VALUE&quot;>
When you submit the form,you can retrieve the value by
writing Request.Form(&quot;ITRON&quot;),this retrieves the value assigned to the hidden field called &quot;ITRON&quot;.Now this retrieved field can be stored in Db.
As far as duplicate Ids...i would lile to ask you how these IDs are generated..can't these IDs be unique..?
Regards
Tushar
 
Hi Itron
********************************
can't these IDs be unique..?
********************************
Two types of information will be into into this form and stored into the database.
One will be manual which is a 10-digit number.
That is how we know that the ID is entered manually.
The other will be an ID that was already in another database.
What I am trying to understand is when an ID is inserted into one table, we want to retrieve that id from that table into a recordset, pass the id into a form as a hidden field and insert it into another table but we want it to be a hidden field where this processes is done behind the scene and no one has to monitor it.
The only concern we have is since some of those IDs will be entered manually, and since the ID from another table is unique ID, is the user going to run into a situation where they may attempt to insert that number twice and get an error message that says this number already exists.
Here is an example:
ID 1 is created for table1 via online registration.
That number (ID numbber 1) is retrieved from table1 and inserted into table2 via a hidden field along with the rest of information about that registrant.
Then a day later, there is a manual entry with a 10-digit id let's say 1234567890 that need to be inserted into table2.
Is there any chance that the ID that was inserted via a hidden field (ID number 1) will be inserted again?
Can I get an example of how this can be achieved, please?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top