Jump to content

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

Recommended Posts

Posted

I am trying to include a simple check box on one of my forms. Basically I want it to return a value of 1 if it is checked, and no value, or a value of 0 if it is not checked. The CDML reference guide had an example...

<input type="checkbox" name="Country" value="F1">France

But I dont quite get how to change it to fit my needs. I assume in the example above that if the box is checked then F1 is input into the FM field called "Country."

So If I want a 1 to appear in my field if it is checked would it be something like this:

<input type="checkbox" name="FieldName" value="1">0

LR

Posted

You can have a second Checkbox with the value of 0. For example:

<input type="checkbox" name="FieldName" value="1">Yes

<input type="checkbox" name="FieldName" value="0">No

Note that the Fieldname is the same for both Checkboxes.

Alternatively, you can use some Javascript to check and "clear" the value before the form is submitted to FM.

All the best.

Garry

Posted

OUCH! You must be kidding. There is no way of using a simple check box or a radio box, that when checked, and then when submit is selected in the form, will send a 1 to that field in FM?

LR

Posted

Larry,

A single box will do that, however unchecking the box will not clear the value. Try this:

<input type="hidden" name="MyField" value="">

<input type="checkbox" name="MyField" value="1">0

A couple of god threads exist on this subject. I will do a search to familarise myself on what so of the outcomes where.

All the best.

Garry

This topic is 7710 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.