Insert form results to a hidden field...
Heya, I have a page search.asp with a form in it which has text and list menus.
Text Fields: KeywordSearch
List Menu: CategoryTable
List Menu: Location
Button: Search
When you submit the search button the search.asp page directs to the results.asp page with the search result.
Going back to the search.asp page. I would like to create a second form on the same page which would have 4 hidden text fields.
Hidden Field: KeywordSearch, CategoryTable, Location, UserName.
Is it possible to pass the entered information from the Text Fields and List Menu to the Hidden Fields?
The reason for wanting to do this is so that I can create an Insert Record. When submitting from the search page, the insert record will also submit to a database which will show me what the users are searching for.
Tanks Heaps
Mally
Busy posted this at 09:53 — 1st June 2006.
He has: 6,151 posts
Joined: May 2001
You have 3 of the things going to the results page anyway, so on the results page just add the database query at top before the results.
As for the UserName, are you using cookies or anything? if so get it from there, otherwise just add to the search form on search page
Welcome to TWF
malhyp posted this at 16:02 — 2nd June 2006.
They have: 2 posts
Joined: May 2006
Hey there, so in the results.asp page I create a recordset that pulls the results. How do I get the results submitted to the database from there? The username is being passed with a session variable.
Busy posted this at 23:16 — 2nd June 2006.
He has: 6,151 posts
Joined: May 2001
I only know PHP, not ASP so am not sure of the code needed, bascially opposite to receiving the database info, with PHP it would be select * from ... (get stuff from database) and insert into ... (put stuff in database).
The form data would be the same stuff used to get the results as it would be recorded in the database. Hopefully someone that knows ASP can show you the code needed.
Basically it goes like this:
results page
get data from form
get username from session
validate all input, if anything blank or wrong go back to search page with error
insert searched data into database
get form query data from database that matches user input
display results
wish them a happy day and remind them to watch out for the plant on their way out
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.