Mike H Posted July 9, 2000 Posted July 9, 2000 I have an html form with checkboxes that update fields in my database. Here's my code: [FMP-Valuelist:Answer_a,List=A] <input type="checkbox" name="Answer_a" value="[FMP-ValueListItem]" [FMP-Valuelistchecked]> [/FMP-Valuelist] When a checkbox is checked it updates the database. The problem is that when I uncheck the checkbox it stays checked. How do I make it stay unchecked? Cheers, Mike
Keith M. Davie Posted July 18, 2000 Posted July 18, 2000 Mike, have you considered writing a script which would use the code line "Clear [field name]" and which would be activated from your form action or link? Don't know that this will help with your structure, but it might be worth looking into. Peace Keith M. Davie
Vaughan Posted August 17, 2000 Posted August 17, 2000 You don't need no steekin' scripts! Just use the correct code to make it happen for you in the first place. Here is the whole kit-and-caboodle. in the example, the value list's name is "Discussion" and the field that it is associated to ois also called "Discussion." [FMP-VALUELIST: Discussion, LIST=Discussion] <INPUT TYPE=checkbox NAME=Discussion VALUE="[FMP-ValueListItem]"[FMP-ValueListChecked]>[FMP-VALUELISTITEM: Always, HTML]<BR> [/FMP-VALUELIST] The trick here is the [FMP-ValueListChecked] CDML code, it does all of the magic for you.
Pegges Posted September 26, 2000 Posted September 26, 2000 Nope, this still doesn't do it. I have the same problem with checkboxes that stay checked in the database. Is there something we haven't considered thoroughly?
Pegges Posted October 4, 2000 Posted October 4, 2000 The mystery has been solved! And it works The only thing you have to modify (at least I did, try for yourself) is not to include the field name as an attribute in the input tag, which is contrary to FileMaker Inc.'s suggestion. Edit: referred to the original source. [This message has been edited by Pegges (edited October 17, 2000).]
Newbies rhygin Posted October 26, 2000 Newbies Posted October 26, 2000 For me the mystery was uh . . . nearly solved. This particular problem is a bit of a nightmare. The info FileMaker support offers is incorrect and Pegges valiant attempt to correct that info did me no good. On a whim, I tried the following, and it worked! You mileage may vary. Do indeed include the hidden input (as FM support suggests), HOWEVER, do not leave the value empty, DO INCLUDE the value list. Also, get rid of the "size=30" (it's hidden for goodness sake). The final code would look like the following. I really hope this helps someone, it was such a pain to figure out :-) <INPUT TYPE=hidden NAME="YES_NO_FIELD" VALUE="YES_NO_LIST"> [FMP-VALUELIST: YES_NO_FIELD, LIST=YES_NO_LIST] <INPUT TYPE=checkbox NAME='YES_NO_FIELD' VALUE='[FMP-ValueListItem]' [FMP-ValueListChecked]>[FMP-VALUELISTITEM: Always, HTML] [/FMP-VALUELIST] ------------------ ~Andrew~ [This message has been edited by rhygin (edited October 26, 2000).]
Pegges Posted October 27, 2000 Posted October 27, 2000 Mystery is no more! Thanks for all the input, people. rhygin's last post solved the puzzle for me.
braman Posted October 28, 2000 Posted October 28, 2000 This is great! Thanks for the help...I've been killing myself over this for a week. -Don [This message has been edited by braman (edited October 27, 2000).]
The Bridge Posted November 7, 2000 Posted November 7, 2000 quote: Originally posted by rhygin: I really hope this helps someone, it was such a pain to figure out :-) Thanks for the sacrifice, Rhygin: your sample code helped me out immensely. [ November 14, 2001: Message edited by: The Bridge ]
tya Posted November 7, 2000 Posted November 7, 2000 The checkbox problem is widespread. FMpro is not the only server to have to deal with this horrible cludge. The "lack of content" associated with turning off a checkbox is dealt with by both browsers - as well as by commercial web server - in many crappy and cludgy manners... loading the cgi stream with hidden input is usually the solution. out of curiousity: did the above solution work with both browsers??
Recommended Posts
This topic is 8850 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now