Forums

Validation groups

petersen 05 Feb, 2014
I have a form broken down into 4 <fieldset> setup as an accordion. Each panel of the accordion has a button which is 'Proceed to next step'. I'm using Chronoforms validation and would like to validate each fieldset when I click the button. Is it possible to call the validation for a set of fields not the entire form?

Thanks

Pete
Max_admin 05 Feb, 2014
Hi Pete,

That's not easy, you may make it a multi page form, that would validate each page before going to the next one.

Other users may have posted solutions for this in the past, so you may also search the forums!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
petersen 06 Feb, 2014
If I put the validation of each fieldset to one side, I've found http://www.chronoengine.com/faqs/58-cfv4/cfv4-elements-and-html/2660-how-can-i-build-a-tabbed-form.html

which gives me a good starting point and the demo at http://greyhead.org/index.php?option=com_chronoforms&tmpl=component&chronoform=demo_form_sliders does what I want. The problem I have is that I've custom built my form rather than using the Wizard.

As a result, my validation call in the head references FormCheckMax, rather than FormCheckJPane. How do I get it to switch when using a custom form?
petersen 06 Feb, 2014
Looks like I need to add

<?php jimport("joomla.html.html.tabs");?>

to the top of my form code. Which is a little silly as it's already working but no biggie.

The problem I have now is that when I submit the form and the validation runs, it opens the correct panel (that has the incorrect field) but the panel is blank (actually opacity: 0).

Any ideas?
Max_admin 07 Feb, 2014
Please upgrade to the latest v4 for Joomla 3, it had a fix for the tabs, just install it OVER yours!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
petersen 11 Feb, 2014
I've updated, but I still get formcheck-max loaded and not formcheck-jpane.

Looking at cfaction_show_html.php line 245, the test is for

if(strpos($form->form_details->content, 'jimport("joomla.html.pane");') !== false){


Whereas in Joomla 3.2, I thought it was

jimport("joomla.html.html.slider")


?
petersen 11 Feb, 2014
Further to this, if I add <?php jimport("joomla.html.html.slider");?> to the top of my form HTML, it loads the formcheck-jpane but I revert back to the blank accordion slide when I validate.
petersen 11 Feb, 2014
I wonder if I'm missing something here? I've used custom HTML, rather than the wizard so don't have container fields cf_ etc. Could that be the problem? I'm building my slider using:


<?php jimport("joomla.html.html.slider");?>
<?php echo JHtmlSliders::start('booking-slider',array('useCookie' => '1','opacity' => '0'));?>
	<?php echo JHtml::_('sliders.panel', JText::_('Party Guest & Cost Information'),'panel1id'); ?>
		<fieldset>
...first fieldset...
etc
Max_admin 11 Feb, 2014
Hi petersen,

Of course, the js code was modified to find the fields under specific containers created by the wizard, if you have your own markup structure then the code will need to be modified, I suggest that you add the same containers classes to your custom html.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
petersen 12 Feb, 2014
I see that the wizard applies unique ids to each element. Will I need that or just the wrapping containers?
Max_admin 12 Feb, 2014
Maybe just the containers in order to get the selectors in the validation file to work correctly, because if the container's element is not found by the selector then the code fails!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
petersen 12 Feb, 2014
hmmm this is a strange one. I added the wrapper classes but this didn't change anything. The only way I've got it to work is to add

tabBody.getFirst('div.pane-slider').setStyle('opacity', '1');


to formcheck-jpane.js. I'm guessing something is slightly wrong with the field I'm targetting.

Of course, the only problem then is that the validation popup stays there even if you switch panels.
Max_admin 12 Feb, 2014
That code may not be enough, you will have to display the tab's body, and hide the other one which is not active, and do the same for the tabs titles.

I suggest that you simply give your tabs containers the same classes as in the validation js code, or use your form code into custom code elements and place them inside Chronoforms normal tabs using containers, you can then style the generated tabs if you like!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
petersen 12 Feb, 2014
Makes sense. Thanks for your help on this.

Out of interest, do you know of a way to add a button to each panel to switch to the next panel?
Max_admin 12 Feb, 2014
Please check this FAQ:
http://www.chronoengine.com/faqs/58-cfv4/cfv4-elements-and-html/2660-how-can-i-build-a-tabbed-form.html
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
petersen 12 Feb, 2014
That works for the tabbed version but not the slider?
Max_admin 13 Feb, 2014
I think so yes, its a custom code, and is used mainly for tabs, changing it to work for sliders will require writing new code and testing it.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.