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!

Default value on menu generated by asp 1

Status
Not open for further replies.

hallm

Programmer
Jun 11, 2000
159
US
I have a asp script that generates a menu from a database table the user selects one of the options then when that page is submitted it saves it to the database.&nbsp;&nbsp;I also have a editor script that allows the user to edit the information that they put into the database.&nbsp;&nbsp;How can I still use the database driven menu but have the default option selected (default being the original option that they submitted).&nbsp;&nbsp;I'm using the following code to generate my menu.<br><br>&lt;select name=&quot;storytype&quot; size=&quot;1&quot;&gt;<br>&lt;%<br>Dim stype<br>storytype.MoveFirst<br>do while Not storytype.eof<br>stype = PrepForHtml(storytype.Fields(&quot;storytype&quot;).Value)<br>%&gt;<br>&lt;option value=&quot;&lt;%=stype%&gt;&quot;&gt;&lt;%=stype%&gt;<br>&lt;%<br>storytype.MoveNext<br>loop%&gt;&lt;/select&gt;
 
Hi,<br><br>use &lt;option selected&gt;&lt;%=userinput%&gt;&lt;/option&gt; <p>din<br><a href=mailto:tidrus@bigfoot.com>tidrus@bigfoot.com</a><br><a href= > </a><br>ICQ # 26094048
 
I suppose that you have 2 tables one containing the contents of the combo box and an other where a user selected preference is being stored<br><br>&nbsp;now you want the one where the user has selected to be selected then you have to have a if condition so that it checks each value as it comes from the database and make it selected only when the one stored from the database comes up<br>&nbsp;<br>&nbsp;regards <p>Unicorn11<br><a href=mailto:webmaster@tripmedia.com>webmaster@tripmedia.com</a><br><a href= > </a><br>Hi there it all likeminded fellows!!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top