OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

Results replaced by dropdown menu on edit page

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> Results replaced by dropdown menu on edit page
Page: [1]
 
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>

(in reply to Mav44)
Mav44

 

Posts: 197
Joined: 6/25/2006
Status: offline

 
RE: Results replaced by dropdown menu on edit page - 9/29/2009 20:20:09   
Still banging my head on the desk with this one. I have been trying new code all day and the one before with the $ comes close but brings back in both results "Select" and the "Region"

I have been trying something like

<label>
<select name="a_region" size="1" id="<%=a_region%>">
<option selected value=""><%If ("a_region") > 0 Then %>
<%=a_region%><%End If%>Select$<option>
<option value="East">East</option>
<option value="Midwest">Midwest</option>
<option value="South">South</option>
<option value="West">West</option>
</select>
</label>

But I think this is way off base.

Maybe something Like


<option selected value="<%=a_region%>" <%If isNull Then :Response.Write("")%>>Select</option>



Please help before they lock me up:)

< Message edited by Mav44 -- 9/29/2009 20:50:30 >

(in reply to Mav44)
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??????

(in reply to Mav44)
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

(in reply to Mav44)
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!

(in reply to ou812)
ou812

 

Posts: 1705
Joined: 1/5/2002
From: San Diego
Status: offline

 
RE: Results replaced by dropdown menu on edit page - 9/30/2009 12:23:27   
Excellent. Glad it worked for you!

I was getting tired of watching you talk to yourself :) so I thought I should step in.

_____________________________

-brian

Black Holes suck.

EnterpriseDB: Enterprise-class relational database management system
PostgreSQL: The world's most advanced open source database

(in reply to Mav44)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> Results replaced by dropdown menu on edit page
Page: [1]
Jump to: 1





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