OutFront Forums
     Home    Register     Search      Help      Login    

Sponsors
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax
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.

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

 

Yes/No select box

 
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 >> Yes/No select box
Page: [1]
 
 
jeffmetcalf

 

Posts: 186
Joined: 3/16/2002
From:
Status: offline

 
Yes/No select box - 3/25/2002 16:24:27   
can any one see whats wrong with this?

<%Dim fpforsale
fpforsale=FP_FieldVal(FP_rs,"ForSale")
%>
<select size="1" name="ForSale">
<option value="Yes" <%if fpforsale = "yes" then response.write "selected"%>>Yes</option>
<option value="No" <%if fpforsale = "no" then response.write "selected"%>>No</option>
</select></td>

have tried true/false, yes/no, 1/0 can't get anything to work.



Spooky

 

Posts: 26723
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Yes/No select box - 3/26/2002 0:54:06   
When in doubt, response write the value, itll show you the value returned.

<%Dim fpforsale
fpforsale=FP_FieldVal(FP_rs,"ForSale")
response.write fpforsale
response.end
%>

§þððk¥
Database / DRW Q & A
VP-ASP Shopping cart
Spooky Login

(in reply to jeffmetcalf)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Yes/No select box - 3/26/2002 11:13:01   
If you're using Yes/No fields from an Access DB, then you'd probably use:

<%Dim fpforsale
fpforsale=FP_FieldVal(FP_rs,"ForSale")
%>
<select size="1" name="ForSale">
<option value="Yes"<%if fpforsale = "True" then response.write(" selected")%>>Yes</option>
<option value="No"<%if fpforsale = "False" then response.write(" selected")%>>No</option>
</select></td>

 

(in reply to jeffmetcalf)
jeffmetcalf

 

Posts: 186
Joined: 3/16/2002
From:
Status: offline

 
RE: Yes/No select box - 3/26/2002 12:22:01   
Here is what I have:

<% Dim fpShare
fpShare=FP_FieldVal(fp_rs,"ForShare")
%>

<input type='checkbox' name=ForSaleck <%if fpShare="True" then response.write "checked"%>
I get a blank box, whether using fpShare or FP_FieldVal(fp_rs("ForShare")

<% if FP_FieldVal(fp_rs,"ForShare")="True" then response.write "poo" else response.write "crap"%>

->evaluates to true and writes "poo"(actual value)
<% =FP_FieldVal(fp_rs,"ForShare")%>

->this also evaluates to true (actual value)
<% response.write FpShare%>

->evaluates to true (actual value)

but using either the var or the acutal value leaves me with a blank box.

http://www.getawayexchange.com/Prop_copy.asp
is the page.


Thanks



(in reply to jeffmetcalf)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Yes/No select box - 3/26/2002 12:32:14   
It looks like you're not closing your checkbox element properly and are missing some quotes. Try using:

<input type="checkbox" name="ForSaleck" <%if fpShare="True" then response.write("checked")%>>

Also as a general rule of thumb, I always encapsulate my response.writes with parens...

Edit: Hard to see difference, but notice the 2 >'s at the end of the line. It looks like you only had one.

Edited by - rdouglass on 03/26/2002 12:34:21

(in reply to jeffmetcalf)
jeffmetcalf

 

Posts: 186
Joined: 3/16/2002
From:
Status: offline

 
RE: Yes/No select box - 3/28/2002 15:47:56   
thank you


(in reply to jeffmetcalf)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> Yes/No select box
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