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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select info to display database info in first field

Status
Not open for further replies.

Ragol1

Programmer
Oct 25, 2001
315
US
This works but only displays current record
<INPUT TYPE=&quot;text&quot; NAME=&quot;Test&quot; value=&quot;<%=rs( &quot;Test&quot; ) %>&quot;>

But I want to display the original info from database and use
The first field will be database info this below doesnt work any ideas
After they select one they click update and it updates database with their selection
<select name=&quot;Test&quot;>
<option value=&quot;<%=rs( &quot;Test&quot; ) %>&quot;></option>
<option value=&quot;1&quot;>1</option>
<option value=&quot;2&quot;>2</option>
<option value=&quot;3&quot;>3</option>
</select>
 
could you redefine your problem? i couldn't quite follow what you're asking.
 
I have a few pages that let me edit a databse

When a user get th where they can edit their info it displays the fields they are allowed to edit in text boxes and already in the fields is the info from the database.
They can then change the info and press update and it updates the info..
What I want is on 2 or 3 of these fields I want it to display the current info but only allow them to change it for pre determined info from a select box

I use this now and it works
<INPUT TYPE=&quot;text&quot; NAME=&quot;Test&quot; value=&quot;<%=rs( &quot;Test&quot; ) %>&quot;>

but i want something like
<select name=&quot;Test&quot;>
<option value=&quot;<%=rs( &quot;Test&quot; ) %>&quot;></option>
<option value=&quot;1&quot;>1</option>
<option value=&quot;2&quot;>2</option>
<option value=&quot;3&quot;>3</option>
</select>

I have tried this but it doesnt work








 
Is this what you're looking for? A way to indicate what is already in the database?

<select name=&quot;Test&quot;>
<option value=&quot;1&quot; <% If rs(&quot;Test&quot;) = 1 Then Response.Write (&quot;selected&quot;) End If %>>1</option>
<option value=&quot;2&quot;&quot; <% If rs(&quot;Test&quot;) = 2 Then Response.Write (&quot;selected&quot;) End If %>>2</option>
<option value=&quot;3&quot;&quot; <% If rs(&quot;Test&quot;) = 3 Then Response.Write (&quot;selected&quot;) End If %>>3</option>
</select>
 
Kinda the first selection &quot;DEFAULT&quot; in the Select statement should be what is in the database the rest of the selection are not in the database they are just like a normal select statement and if a user selects one then clicks update that one replaces the one in the database
 
okay, so what doesn't work in your code that you posted?

but i want something like
<select name=&quot;Test&quot;>
<option value=&quot;<%=rs( &quot;Test&quot; ) %>&quot;></option>
<option value=&quot;1&quot;>1</option>
<option value=&quot;2&quot;>2</option>
<option value=&quot;3&quot;>3</option>
</select>

I have tried this but it doesnt work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top