I'm trying to add new checkbox to a pre existing CRED form,
I can see the checkbox in the form but the value isn't getting to the form submission results
here is the checkbox i'm trying to add (labels are in Hebrew):
[cred_generic_field field='add_to_newsletter' post='contactformsrecords' value='' type='checkbox' class='form-control' urlparam='' output='bootstrap']
{
"required":0,
"validate_format":0,
"checked":0,
"default":"אני מאשר הוספה לרשימת הניוזלטר",
"label":"הוסף אותי לרשימת הניוזלטר"
}
[/cred_generic_field]
and here is all of the code for the form:
[credform class='cred-form cred-keep-original']
<div class="FooterForm">
<div class="form-group form-groupFullW">
[cred_field field='myfirstname' post='contactformsrecords' value='' urlparam='' placeholder='שם פרטי' class='form-control' output='bootstrap']
[cred_field field='mylastname' post='contactformsrecords' value='' urlparam='' placeholder='שם משפחה' class='form-control' output='bootstrap']
</div>
<div class="form-group form-groupFullW">[cred_field field='myphone' post='contactformsrecords' value='' urlparam='' placeholder='מספר טלפון' class='form-control' output='bootstrap']
[cred_field field='myemail' post='contactformsrecords' value='' urlparam='' placeholder='דואר אלקטרוני' class='form-control' output='bootstrap']
</div>
<div class="form-group form-groupFullW">
[cred_field field='lead-subject' post='contactformsrecords' value='' urlparam='' class='form-control' output='bootstrap']
</div>
<div class="form-group form-groupFullW">
[cred_field field='post_excerpt' post='contactformsrecords' value='' urlparam='' class='form-control' output='bootstrap']
</div>
<div class="add_to_newsletter form-group form-groupFullW">
[cred_generic_field field='add_to_newsletter' post='contactformsrecords' value='' type='checkbox' class='form-control' urlparam='' output='bootstrap']
{
"required":0,
"validate_format":0,
"checked":0,
"default":"אני מאשר הוספה לרשימת הניוזלטר",
"label":"הוסף אותי לרשימת הניוזלטר"
}
[/cred_generic_field]
<div style="visibility: hidden; height: 2px;">
[cred_field field='post_excerpt' post='contactformsrecords' value='' urlparam='' class='form-control' output='bootstrap']
[cred_field field='contactsorce' post='contactformsrecords' value='[wpv-post-title output="sanitize"]' urlparam='' class='form-control' output='bootstrap']
[cred_field field='contactsorceurl' post='contactformsrecords' value='[wpv-post-url]' urlparam='' class='form-control' output='bootstrap']
[cred_field field='cc-name' post='contactformsrecords' value='מנהל אתר' urlparam='' class='form-control' output='bootstrap']
[cred_field field='lead-sorce-form' post='contactformsrecords' value='Contact-Page-Form' urlparam='' class='form-control' output='bootstrap']
</div>
[cred_field field='form_messages' value='' class='alert alert-warning']
<p style="text-align: left;">[cred_field field='form_submit' value='שלח' urlparam='' class='btn btn-primary btn-lg' output='bootstrap']</p>
</div>
[/credform]
I can see the checkbox in the form but the value isn't getting to the form submission results
Okay I can see you have added a generic field. In order to save the value of a generic field, you must use custom code. If you do not want to write custom code, you can add the checkbox field to the Field Group for this post type, and rebuild the Form. Can you explain where you want to save the generic field value?
Hi
Christian,
thank you for your replay
I'v change the field from generic field to checkbox field as you suggested and it's working now, what i missed in first was that I needed first to add the field to the relevant custom fields group.
thank you,
have a nice day