|
| |
|
|
Mav44
Posts: 197 Joined: 6/25/2006 Status: offline
|
Results replaced by dropdown menu on edit page - 9/28/2009 19:26:42
I am using the code below to pull the data back to the orignal page for editing. All the results are coming back fine except where I have drop down menus. On those the recalled data is replaced by the initial state of the drop down menu, in most cases "select". Any Ideas are appreciated! if st = "edit" then id = request.querystring("id")' request the id of the record you need to change sql = "select * from doghouse where id = " & id ' select the single record set rs = myconn.execute(sql) a_region = trim(rs("a_region")) b_distributor = trim(rs("b_distributor")) c_salesman = trim(rs("c_salesman")) d_series = trim(rs("d_series")) etc,etc
|
|
|
|
Mav44
Posts: 197 Joined: 6/25/2006 Status: offline
|
RE: Results replaced by dropdown menu on edit page - 9/29/2009 1:15:02
Looks like I may have jumped the gun and it is my results in the menu that I need to figure out how to handle. If there is a result in the table I want the top selection of the menu to be that result. If there is no reulst in the table I want the table to say "Select". This almost works <option selected value="a_region">Select$<%=a_region%></option> but I end up with both Select$ and my Table Result. I am thinking I may need some type of >0 statement to get my menu to use the result if found and if not to default to select. Full menu code below <label> <select name="a_region" size="1" id="<%=a_region%>"> <option selected value="a_region">Select$<%=a_region%></option> <option value="East">East</option> <option value="Midwest">Midwest</option> <option value="South">South</option> <option value="West">West</option> </select> </label>
|
|
|
|
Mav44
Posts: 197 Joined: 6/25/2006 Status: offline
|
RE: Results replaced by dropdown menu on edit page - 9/30/2009 11:37:40
I am still fighting this demon this morning. My latest direction has me trying something like, <label> <select name="a_region" size="1" id="<%=a_region%>"> <option value="" selected><if ("a_region")="NULL" then Response.Write("Select")else Response.Write("a_region") end if></option> <option value="East">East</option> <option value="Midwest">Midwest</option> <option value="South">South</option> <option value="West">West</option> </select> </label> Still not working. Can anybody make a suggestion, Spooky, BtheBall, Texan??????
|
|
|
|
ou812
Posts: 1705 Joined: 1/5/2002 From: San Diego Status: offline
|
RE: Results replaced by dropdown menu on edit page - 9/30/2009 11:55:01
I'm not exactly sure what you're trying to do. If I'm understanding you seem to be really close. Maybe something like this:
<% if (len(a_region & "") = 0) then %>
<option value="" selected>Select</option>
<% else %>
<option value="" selected> <%= a_region%></option>
<% end if %>
I broke it out just for easier reading for me. Again though, not sure if that is what you're looking for.
_____________________________
-brian Black Holes suck. EnterpriseDB: Enterprise-class relational database management system PostgreSQL: The world's most advanced open source database
|
|
|
|
Mav44
Posts: 197 Joined: 6/25/2006 Status: offline
|
RE: Results replaced by dropdown menu on edit page - 9/30/2009 12:03:37
That is exactly what I was trying to do!!!!! Thanks for your help, you made my day!
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|