Jump to content
Server Maintenance This Week. ×

Checkboxes


This topic is 8586 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

  • 2 weeks later...
  • 5 weeks later...

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.

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 4 weeks later...
  • Newbies

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).]

Link to comment
Share on other sites

  • 2 weeks later...

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 ]

Link to comment
Share on other sites

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??

Link to comment
Share on other sites

This topic is 8586 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.