Hi, i made a simple checkbox for user registration on joomla:
0=No
1=Yes
2=Maybe
3=I don't know..
now I want that if the user selects "no" or "maybe" or "i don't know.." the registration fails when press "submit" button (with appropriate warning), and if user select "yes" the recording/registrer user on joomla can continue.
how i can do this?
thank you,
thezak
0=No
1=Yes
2=Maybe
3=I don't know..
now I want that if the user selects "no" or "maybe" or "i don't know.." the registration fails when press "submit" button (with appropriate warning), and if user select "yes" the recording/registrer user on joomla can continue.
how i can do this?
thank you,
thezak
Hi thezak,
That sounds like custom Serverside validation would do that OK.
Bob
That sounds like custom Serverside validation would do that OK.
Bob
hi GreyHead,
you mean "custom code" (in basic tab) or "server validation" (in validation tab) ?
In any case I am not a programmer and do not know what to write .. can you tell me the right way to compile the code? or some site that has an example of programming similar to mine?
i need like this:
http://www.w3resource.com/php/form/php-form-validation.php
(terms and conditions)
but i have 4 check input.. and i can't integrate correctly wath i see on this example, variables are a mystery to me...
Thank you,
thezak
you mean "custom code" (in basic tab) or "server validation" (in validation tab) ?
In any case I am not a programmer and do not know what to write .. can you tell me the right way to compile the code? or some site that has an example of programming similar to mine?
i need like this:
http://www.w3resource.com/php/form/php-form-validation.php
(terms and conditions)
but i have 4 check input.. and i can't integrate correctly wath i see on this example, variables are a mystery to me...
Thank you,
thezak
Hi,
In v5 the "custom server validation" is the "event switcher", you will need to add one action at the top of the "on submit" event and paste a code like this:
And then add a "show stopper" action inside the "on fail" event of the "event switcher".
FAQ:
http://www.chronoengine.com/faqs/70-cfv5/5212-event-switcher.html
In v5 the "custom server validation" is the "event switcher", you will need to add one action at the top of the "on submit" event and paste a code like this:
<?php
if($form->data["radio_name"] == "yes"){
return "success";
}else{
return "fail";
}
And then add a "show stopper" action inside the "on fail" event of the "event switcher".
FAQ:
http://www.chronoengine.com/faqs/70-cfv5/5212-event-switcher.html
Hi Mr. Admin,
I added your code and follow the step by step procedure, but does not seem to work. what happens is that the recording is done the same and do not see the page generated by "display message".
thank you,
thezak
I added your code and follow the step by step procedure, but does not seem to work. what happens is that the recording is done the same and do not see the page generated by "display message".
thank you,
thezak
Did you update the radio name in the line below to your radio field name ?
Please also post a screenshot for your current events setup!
if($form->data["radio_name"] == "yes"){
Please also post a screenshot for your current events setup!
hi,
i set radio button like this image:
http://s13.imagestime.com/out.php/i942040_radio13.jpg
here you can see my radio button: http://s13.imagestime.com/out.php/i942046_radio132.jpg
and this is my setup:
http://s13.imagestime.com/out.php/i942047_radio133.jpg
I would make sure that if the user press "yes", the form must be completed (if other parameters are corrects of course), but any other choice leads to a warning of any kind.
i see that radio button have tab "dynamic data" and "event".. not possible to use this tab in some way for my problem ?
thank you very much.
thezak
i set radio button like this image:
http://s13.imagestime.com/out.php/i942040_radio13.jpg
here you can see my radio button: http://s13.imagestime.com/out.php/i942046_radio132.jpg
and this is my setup:
http://s13.imagestime.com/out.php/i942047_radio133.jpg
I would make sure that if the user press "yes", the form must be completed (if other parameters are corrects of course), but any other choice leads to a warning of any kind.
i see that radio button have tab "dynamic data" and "event".. not possible to use this tab in some way for my problem ?
thank you very much.
thezak
Hi thezak,
Your current setup would display a blank page if the choice is not "yes", otherwise the form setup will be completed as normal, what would you like to change in the current setup ?
Regards,
Max
Your current setup would display a blank page if the choice is not "yes", otherwise the form setup will be completed as normal, what would you like to change in the current setup ?
Regards,
Max
Hi Max,
I would like to appear a warning that explains the inability to continue with registration because the choice is wrong.
As when I enter a user name already in use, the page is reloaded and I get the warning at the top, something like this in practice. That's possible?
thankyou,
thezak
I would like to appear a warning that explains the inability to continue with registration because the choice is wrong.
As when I enter a user name already in use, the page is reloaded and I get the warning at the top, something like this in practice. That's possible?
thankyou,
thezak
Just add "Display message" action ABOVE the "show stopper", and write any message you need there!
Regards,
Max
Regards,
Max
Everything is perfect Max!,
but I need another small step to finish my form.
I added two radiobox on my form, both must have a clear choice to be able to continue ("yes").
so I tried to insert like this in "event switcher":
and on "display message" i write about radio_name11 and radio_name22 in case of warning.
but does not seem to work
so i try to add another "event switcher" including only "radio_name22":
(in pratice i clone my first "event swithcer" and change radio_name)
but even in this case it does not work
How i can proceed ?
thank you for you patience.
thezak.
but I need another small step to finish my form.
I added two radiobox on my form, both must have a clear choice to be able to continue ("yes").
so I tried to insert like this in "event switcher":
<?php
if($form->data["radio_name[b]11[/b]"] == "yes"){
return "success";
}else{
return "fail";
}
<?php
if($form->data["radio_name[b]22[/b]"] == "yes"){
return "success";
}else{
return "fail";
}
and on "display message" i write about radio_name11 and radio_name22 in case of warning.
but does not seem to work
so i try to add another "event switcher" including only "radio_name22":
<?php
if($form->data["radio_name[b]22[/b]"] == "yes"){
return "success";
}else{
return "fail";
}
(in pratice i clone my first "event swithcer" and change radio_name)
but even in this case it does not work
How i can proceed ?
thank you for you patience.
thezak.
Hi thezak,
There's a problem with the <?php tags, and the logic in your first example. Please try this:
Bob
There's a problem with the <?php tags, and the logic in your first example. Please try this:
<?php
if ( $form->data['radio_name11'] == "yes" || $form->data['radio_name22'] == "yes" ) {
return "success";
} else {
return "fail";
}
?>
Bob
<?php
Hi,
i publish at this page the form:
http://bruttidibrutto.altervista.org/index.php?option=com_chronoforms5&chronoform=Registrazione_al_sito
i modify like this:
(of course in "design" tab a give appropriate name to fields)
I have tried many times, clicking "si" (=yes) in the first radio and "no" in the second, and vice-versa.. also i set "si" to all (at this point registration must success) .. then the result is always the error page (my display message) and the user is not logged (not receiving any mail and will not be recorded in joomla)
note: if i delete radio, user register in joomla correctly.
I don't understand where i'm wrong.
thank you
thezak.
Hi,
i publish at this page the form:
http://bruttidibrutto.altervista.org/index.php?option=com_chronoforms5&chronoform=Registrazione_al_sito
i modify like this:
(of course in "design" tab a give appropriate name to fields)
if ( $form->data['maggiorenne'] == "si" || $form->data['termini'] == "si" ) {
return "success";
} else {
return "fail";
}
?>
I have tried many times, clicking "si" (=yes) in the first radio and "no" in the second, and vice-versa.. also i set "si" to all (at this point registration must success) .. then the result is always the error page (my display message) and the user is not logged (not receiving any mail and will not be recorded in joomla)
note: if i delete radio, user register in joomla correctly.
I don't understand where i'm wrong.
thank you
thezak.
Hi theezak,
It looks as though the values of maggiorenne are 0, 1, 2, or 3 so it can never be 'si'
Bob
It looks as though the values of maggiorenne are 0, 1, 2, or 3 so it can never be 'si'
Bob
Hi Bob,
i understand that, but i made like this :
the registration done when i wrong just one radio (es: maggiorenne=yes and termini=no or vice-versa)
but i need registration fail when i wrong just one of 2, and success only if the response of the two radio is "si" (value 1)
seems that enough just one of them is successful
I do not know if I need to change the php code you have given me, or if there is an error in some other part of the form outside of the radio
thank you
thezak
i understand that, but i made like this :
if ( $form->data['maggiorenne'] == "1" || $form->data['termini'] == "1" ) {
return "success";
} else {
return "fail";
}
?>
the registration done when i wrong just one radio (es: maggiorenne=yes and termini=no or vice-versa)
but i need registration fail when i wrong just one of 2, and success only if the response of the two radio is "si" (value 1)
seems that enough just one of them is successful
I do not know if I need to change the php code you have given me, or if there is an error in some other part of the form outside of the radio
thank you
thezak
Hi thezak,
If you want both to be == 1 then change the OR || for AND &&
Bob
If you want both to be == 1 then change the OR || for AND &&
Bob
Perfect! now the module works in an "interesting way", as Spock would say, second in command of the Enterprise!
thank you very much for your support!
thank you very much for your support!
This topic is locked and no more replies can be posted.