|
| |
|
|
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: 26597 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
|
|
|
|
rdouglass
Posts: 9167 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>
|
|
|
|
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
|
|
|
|
rdouglass
Posts: 9167 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
|
|
|
|
jeffmetcalf
Posts: 186 Joined: 3/16/2002 From: Status: offline
|
RE: Yes/No select box - 3/28/2002 15:47:56
thank you
|
|
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
|
|
|