Hi
I have an problem with my form regarding event for multiple conditions. I want to do like below using radio box question.
Target: To open/enable/visible additional container when all the question (radio box) have value = Yes
and in my container have a few fields.
I have 4 YES/NO question using radio box, but i want this additional container will enable if ALL the question selected into YES.
But if ONE of these question selected to NO, additional container remain hide during form load.
How can achieve this method.?
Hi chekwan,
You can do this using Custom JavaScript or PHP to check the radio button settings and show/hide the container.
I'm not clear if you need to do this in the browser or if the container is on a second page of a multi-page form?
Bob
Hi GreyHead
All field is in one page, but I divided the field sections by using container (container A & container B)
If all the question in container A stated all the value in YES, the question in container B will appear.
But if one of the question in container A have NO value, the container B still remain hide.
They need to fill all the question, before submit.
Hi GreyHead,
Appreciate if you can give me the php code of the conditions since I'm no familiar with the PHP langguage and where to put the code.
Hi chekwan,
Is the form on-line? - if so please post a link; if not, what are the names and IDs of the radio buttons and the container you need to show/hide?
Bob
Hi GreyHead
here the link:
http://www.chekwan.com/projects/borneo/
I want the container name Appointment Details will enable when user select ALL the radio box button into YES..
before they can submit the form. But in default (load form) the container in hidden mode
Hi..
Any answer for my problem.?
Hi GreyHead
Thanks for the reply... and sorry for the multiple posting
from the code given. I have paste the code in Setup tab and drag Load Javascript into On Load action, I change the name of the elements.. save and view form..
but nothing happened.
Please guide me where actually I need to paste these script or any missing steps.?
thanks
Hi chekwan,
I don't see the JavaScript on the page at all. Do you have the Load JS action *before* the HTML (Render form) action? If not please drag it up.
Bob
Hi,
There was a small issue in the code, please try this version:
jQuery(document).ready(function(jQ){
jQ('#chronoform-container-4').hide();
checkRadios();
jQ('.gbs3 :radio').change(checkRadios);
function checkRadios() {
var radio1, radio2, radio3;
radio1 = jQ('input[name=radio1]:checked').val();
radio2 = jQ('input[name=radio2]:checked').val();
radio3 = jQ('input[name=radio3]:checked').val();
if ( radio1 == 'Yes' && radio2 == 'Yes' && radio2 == 'Yes' ) {
jQ('#chronoform-container-4').show();
} else {
jQ('#chronoform-container-4').hide();
}
}
});
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi GreyHead & Max
Yes.. thats what I want! works perfectly..
thanks for both of you..
seems I owed both of you a cups of coffee!
thanks again.. cheers!