|
| |
|
|
EasyBee
Posts: 13 Joined: 5/1/2003 Status: offline
|
Setting Checkbox during DRW - 7/24/2007 14:01:43
I’ve got a DRW form with 50+ Features, each feature is a checkbox.. ps_feature01, ps_feature02, ps_feature03 etc…. ps_feature01 Value is “Power Steering”, I’m trying to set the checkbox On or Off based on contents of field.. DBF field type is Text not Yes/No so “Power Steering” is stored in field if checkbox is ON.. Code: <input type="checkbox" name="ps_feature01" <% IF Trim(Request(FP_FieldHTML(fp_rs,"ps_feature01"))) = "Power Steering" Then Response.Write " checked"%> value="Power Steering"> Power Steering</font></td> What is wrong with this code? I’ve tried all I know to get this to work, I have changed the “=” sign to “<>” and the box gets set ON, I know the ps_feature01 field is “Power Steering” coming from DBF… I've also researched this forum and have found some information but not any thats requesting FP_FieldHTML
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Setting Checkbox during DRW - 7/24/2007 14:15:00
quote:
IF Trim(Request(FP_FieldHTML(fp_rs,"ps_feature01"))) = "Power Steering" Then If it's an Access DB, I'd try this: IF FP_Field(fp_rs,"ps_feature01") = -1 Then If they are Yes/No fields that should work. Note that I did *not* use FP_FieldHTML but rather just FP_Field. Hope it helps. <shameless>P.S. DId you see the link regarding checkboxes in my sig?</shameless> Doesn't use the DRW tho...
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
EasyBee
Posts: 13 Joined: 5/1/2003 Status: offline
|
RE: Setting Checkbox during DRW - 7/24/2007 14:58:53
Its not a Yes/No field, it is a TEXT 40 char long.. It actually holds "Power Steering" if Checked ON And BLANK if OFF.. I tried this: <input type="checkbox" name="ps_feature01" <% IF FP_Field(fp_rs,"ps_feature01") <> " " Then Response.Write " checked"%> value="Power Steering"> Power Steering</font></td> This worked until I made a change to OFF and then back ON.. How can I test for a BLANK field?
|
|
|
|
EasyBee
Posts: 13 Joined: 5/1/2003 Status: offline
|
RE: Setting Checkbox during DRW - 7/24/2007 15:31:59
I think I got it.. This code seems to work.. <input type="checkbox" name="ps_feature01" <% IF Trim(FP_Field(fp_rs,"ps_feature01")) <> "" Then Response.Write " checked"%> value="Power Steering"> Power Steering</font></td> Thanks for your help....
|
|
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
|
|
|