PDA

View Full Version : Newbie in ASP


star2008
08-10-2008, 12:35 PM
I am Newbie to web programming. I started learning ASP recently. I have a situation here. There is a form that takes user feedbacks. We have validated the form and fields. There is a Drop Down menu for a choice of products. Also there is a verification field also that user must type the numbers. After all is done we need to submit the form to email ID. The problem we are facing, is that if any of the field values are entered wrongly then that field gets focussed and all other previous correct fields are taken from the values previously entered. But when it comes to drop down menu how can be get those values selected by the user in the post back page? I hope my question is clear? Anybody has experience in this?

star2008
08-11-2008, 11:11 AM
Hope my question was clear? Is there a way to retrieve the selected value in drop down to asp and display it in the post back form as the selected value.

brazenskies
08-11-2008, 11:39 AM
I'd store the value of each input in a session.

On the original form set the value to nothing if the session is empty, and to the value of the session if there is an active session.

There's probably plenty of other ways to do it!

SSJ
08-14-2008, 01:46 PM
Well If you need to select the previously selected value from drop down by user then you can try something like following:

<select name="cmbSelect">
<option value="1" <%if selectedValue="1" Then Response.write "Selected"%>>1</option>
<option value="2" <%if selectedValue="2" Then Response.write "Selected"%>>2</option>
<option value="3" <%if selectedValue="3" Then Response.write "Selected"%>>3</option>
<option value="4" <%if selectedValue="4" Then Response.write "Selected"%>>4</option>
</select>

Hope it helps...