|
-
May 6th, 2010, 08:50 AM
#2
Re: Submitting part of a selected value to a database
Hi,
You can give each option in an HTML drop down list an optional value as well as the text that shows in the browser. Something like this should help you:
<select name="weeks">
<option value="1">1 screening</option>
</select>
In the above example, "1 screening" will show in the gui in the browser but only the value, 1 will be posted when you submit.
Or, if you are using ASP .NET web form controls then the same can be achieved using:
<asp: DropDownList ID="weeks" runat="server">
<asp:ListItem Value="1">1 screening</asp:ListItem>
</asp: DropDownList>
So, you don't have to write any custom code in the submit button to extract the id because it is all that will be posted.
I hope this helps.
Alan
www.rapidqualitysystems.com - Taking Code Visualization to New Heights
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|