Members

Note: You can use your Sitellite.org account here and vice versa.

Username

Password

Remember Login

Forgot your password?

Not a member? Click here to register

Check Box

Home Page | All Pages | Recently Revised | Authors | Feeds |

Using the MailForm checkbox widget can be done in one of two ways:

  1. As a single checkbox option
  2. As a series of checkbox options

First with a series of options:

[ingredients]

alt = "Ingredients (click all that you'd like)"
type = checkbox
value 1 = Chicken
value 2 = Ham
value 3 = Bacon
value 4 = Lettuce
value 5 = Tomato
value 6 = Mustard
value 7 = Mayonaise

If I include this in a test form, the returned value if I were to select Bacon, Lettuce, Tomato and Mayonaise would be:

Array
(
    [ingredients] => Bacon,Lettuce,Tomato,Mayonaise
    [submit_button] => Save
)

To set the options automatically based on a function, you could replace the value 1, value 2, etc. with a setValues line, like this:

[ingredients]

alt = "Ingredients (click all that you'd like)"
type = checkbox
setValues = "eval: myapp_get_ingredients ()"

Now on to just a single checkbox option:

[agree]

type = checkbox
fieldset = no
value 1 = "I agree with the terms of service"

This field will return one of two results you can check for:

  1. The string "I agree with the terms of service" if the field is checked
  2. A null value if the field was not checked

You could also set this value via a function using setValues however there is usually less need to for just a single checkbox option.

Revision from August 1, 2007 1:15 PM by anonymous

Back in time (1 more) | Linked from: Forms