I have a simple asp page that has a dropdown combo box that is populated from a query to a database when the page is loaded and a text box. The user makes a selection from the drop down box and enters some data in the text boxe. Once everything is ok - hits submit. I want the value of the combobox and data in the text boxes to be sent to another asp page with a form post:
The problem is the <form is outside the %> of the asp code and the data from the combobox is not making it to the other page (the text box data is making it). I assume this is the issue. Any ideas on how to get the value of a combo box to be sent by a form post?
Thanks for replying. The 2 parts of the page are the asp part (inside the <% %>) and the plain html part. The asp part loads the combo box with values from a database. The html part has the <form name="MyForm" method="post" action="Add.asp"> code which takes values from some text boxes which are entered manually after the page loads.
The problem is that when I try to send the value of the text boxes and the combo box to another asp page, the value of the combo box is nothing no matter what I select in the combo box. I tried putting the <form name="MyForm" method="post" action="Add.asp"> code in the asp portion but get an error so I assume the post action has to be outside the asp section. The code is at work or I would post it. I did some searches and the only samples I could find for sending data from one page to another are straight html pages and none sending values from combo boxes.
So I guess the generic question is once a combo box is loaded - how do I send its value to another page via <form name="MyForm" method="post" action="Add.asp">?
Can you post your code. Most likely you have something wrong with request on your code.
Can not say without code.
for example you have combo box id=cmbState inside form.
On the post you need to str_cmbState=request("cmbState")
and then pass this value to what ever you trying to do with it.
You can not do it on straight HTML pages unless you have JavaScript URL processing function. And from your form code I can see that you are submitting to add.asp page.
Best way to help you is to see your code.
You can user variable session("orderid") as your session verification and to make sure that same value not submitted more than once. Normally that is where database indexes comes handy but sometimes it is good idea not to overload database...
Especially access database.
Plus I do not see in your code closing connection. Since your database is Access make sure that you do close connection or your website will die by slow and painful death.
Bookmarks