Jump to content

How to remove the last value from a checkbox/list?


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

Recommended Posts

Posted

Hi from a newcomer to this forum!

I have a booking web page with several FMP fields with the possible choices from a list in FMP. The fields are presented as checkboxes. The user fills out the form, submits it and is referred back to the form which now presents the summarized costs due to the choices. The user now has the choice to edit the form and resubmit...and can repeat this until satisfied. My problem is this:

How to make it possible to remove all values from a field on editing the formpage? If the user unchecks a checkbox this works as far as to the last value which is NOT removed from the FMP field and the reply form page still has the checkbox for that value marked.

The FMP field is text and it does not seem to matter how the field is specified. The code for the field on the web page is:

[FMP-VALUELIST: form_social_program_1, LIST=list_social_program_1]<br>

<input type="checkbox" name="form_social_program_1" value="[FMP-ValueListItem]" [fmp-valuelistchecked]>[FMP-VALUELISTITEM: Always, HTML][/FMP-VALUELIST]

A solution to this would really save my day!!

Regards!

Kjell Nilsson

Posted

Thanks Garry,

your suggestion sets the fileld to "empty field" sure enough but it also overrides the same field formatted as a checkbox list and makes it impossible to set any values from the form.

What I need is a way to have the field with all checkboxes unchecked set/submit "empty value" to the database.

Regards

Kjell Nilsson

Posted

A few hours later....and some trial and error. Garrys solution works but placement of his suggested line on the forms page seems to be critical. This code makes it work:

[FMP-VALUELIST: form_social_program_1, LIST=list_social_program_1]<br>

<input type="checkbox" name="form_social_program_1" value="[FMP-ValueListItem]" [fmp-valuelistchecked]>[FMP-VALUELISTITEM: Always, HTML][/FMP-VALUELIST]<input type="hidden" name="form_social_program_1 value="">

Thanks Garry, you saved my day!

Kjell Nilsson

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