Hello,
I am trying to add a field to a page, a simple checkbox.
If that checkbox is checked, and that I click the SAVE button, nothing should happen. But if that checkbox isn't checked, I need it to send an email when I click on the "SAVE" button, and that it checks that checkbox right after, so that the next time I click SAVE again, it won't trigger the "send_email" function since the checkbox would now be checked.
Simple conditions, but I'm having hard time finding out how to do it.
Right now I have this code in the custom theme code for that page :
And here's the code for that simple checkbox field on the main page file :
Any idea what I should do?
Thanks a lot
I am trying to add a field to a page, a simple checkbox.
If that checkbox is checked, and that I click the SAVE button, nothing should happen. But if that checkbox isn't checked, I need it to send an email when I click on the "SAVE" button, and that it checks that checkbox right after, so that the next time I click SAVE again, it won't trigger the "send_email" function since the checkbox would now be checked.
Simple conditions, but I'm having hard time finding out how to do it.
Right now I have this code in the custom theme code for that page :
- Code: Select all
<cms:if k_success >
<cms:pages id=k_last_insert_id limit='1' show_future_entries='1'>
<cms:if checkbox_checked!='Checked'>
<cms:send_mail from='admin@mysite.com' to="<cms:show conferenciers3/>" debug="1">
EMAIL CONTENT
</cms:send_mail>
<cms:db_persist_form
_invalidate_cache='1'
_token=k_cur_token
checkbox_checked = 'Checked'
/>
</cms:if>
</cms:if>
</cms:pages>
</cms:if>
And here's the code for that simple checkbox field on the main page file :
- Code: Select all
<cms:editable name='checkbox_checked' label="Cancel sent?" type='checkbox' opt_values="Checked" order="0"/>
Any idea what I should do?
Thanks a lot