Hi there, I'm currently using CF 3.1 RC2 - haven't got round to upgrading yet - on joomla V1.5.14.
I've added a checkbox to an existing form which is going to be used by the visitor to indicate whether they want to opt-in to future correspondance. I would like to set it so that if they tick the checkbox, the value sent to the email and database is 'NO', but if they leave it unchecked it sends the value of 'YES'. I realise I could have used two radio buttons instead, but I've used the same function on several other forms for this client on sites outside of Joomla and would like to retain consistency.
I'm not very proficient in javascript/php, so used FormsToGo to generate the other forms php files and was provided with an additional line of code by the developer to manually insert into the php files.
The line of code I have in the HTML is...
Is there a similar piece of code that I can manually insert via CF to achieve the same thing?
Many thanks in advance.
Paul
I've added a checkbox to an existing form which is going to be used by the visitor to indicate whether they want to opt-in to future correspondance. I would like to set it so that if they tick the checkbox, the value sent to the email and database is 'NO', but if they leave it unchecked it sends the value of 'YES'. I realise I could have used two radio buttons instead, but I've used the same function on several other forms for this client on sites outside of Joomla and would like to retain consistency.
I'm not very proficient in javascript/php, so used FormsToGo to generate the other forms php files and was provided with an additional line of code by the developer to manually insert into the php files.
The line of code I have in the HTML is...
<div class="optincheck"><input name="opt_in" type="checkbox" value="No" /></div>
Is there a similar piece of code that I can manually insert via CF to achieve the same thing?
Many thanks in advance.
Paul
Hi there, just to let you know that I've now resolved this issue. After a few hours worth of searching through the forums I came across a post which featured a solution.
For anyone in a similar situation, simply add the following text into the OnSubmit Before Sending Email box...
Kind regards
Paul
For anyone in a similar situation, simply add the following text into the OnSubmit Before Sending Email box...
<?php
JRequest::setVar('input_id', JRequest::getString('input_id', 'Yes', 'post'));
?>
Kind regards
Paul
I will also add a checkbox to my existing form. But i have an email verification running. Do i have to create another table in my database?? Thanks.
Hi Jetsfan,
It's up to you. If you are recording the form results you can probably add the extra columns to the existing table; or you can create a new one just to track the confirmations.
Bob
It's up to you. If you are recording the form results you can probably add the extra columns to the existing table; or you can create a new one just to track the confirmations.
Bob
This topic is locked and no more replies can be posted.