Forums

conditional statement for email subscriber checkbox

cicibar 02 Dec, 2010
I have successfully added the curl function to add someone to my newsletter subscriber list when they complete a sign up form.

But everyone gets added to the email lists whether or not they check a box on the sign up form that confirms they want to receive a newseltter.

So I need a conditional statement:

On the sign-up form, if someone checks the box "yes, I want your newsletter" ( check0 ) , then perform the curl function to add this person to the email subscriber list.

Do you readily have such code, or would it be possible to give me an outline of steps I need to take... and would I still use the curl function?
_Cindy
GreyHead 02 Dec, 2010
Hi Cindy,

There's no way to 'stop' the current family of plug-ins. I'm sure it will be in a future release.

You may be able to do it by hacking the plug-in code. Otherwise you can hand-code the cURL part in one of the OnSubmit boxes and make it conditional on the checkbox result.

Bob
cicibar 03 Dec, 2010
ok, I think a good project for me... don't want to hack - don't know enough to hack! But will try the onsubmit conditional statement for the plugin.
Thank you.
_Cindy
gemlog 16 Oct, 2011
I want just the same thing, but I do have functioning curl code in 'submit after' that runs fine if I hard code a couple of values. I am really stuck trying to figure out which syntax to use to read the form values for name and email -- everything I try comes up empty.

Just what is the syntax to read field values in the "on submit code after sending email" (and the before) code boxes? The faq says this style should work:

echo "trying faq var syntax";
echo $_POST['ufullname'];
echo $_POST['uemail'];
echo "end try faq var syntax;

But all I get out of that is:
"trying faq var syntaxend try faq var syntax"

Those fields are e.g. id="uemail" name="uemail" in the html and they do get stored in the db and are used in emails.

This is joomla 1.5.23 and chrono 3.1 RC5.5

What incredibly stupid thing am I doing wrong bob?
GreyHead 17 Dec, 2011
Hi gemlog,

I'm working through a backlog of very old posts here :-(

In CFv3 I alomost always use the JRequest::getVar('input_name', '', 'post'); syntax to get posted values.

But . . . I would expect the $_POST['input_name'] would work as well.

Bob
This topic is locked and no more replies can be posted.