I have a rather complicated form that includes a check box group. Well, at least, some of the code generating that table is complicated.
[attachment=0]4Bob00.jpg[/attachment]
I can't work out how to build it with the simple check box group controls. I have written a PHP script to generate the table and have included that via a custom code control, using code generated by ChronoForms as a model.
My problem is that, using this technique, Ii can't make the validation 'required' work. Is it possible to modify my script to access the (presumably javascript or mootools) functions that chronoforms uses to force validation required?
I hope this makes sense.
Regards
Nick
[attachment=0]4Bob00.jpg[/attachment]
I can't work out how to build it with the simple check box group controls. I have written a PHP script to generate the table and have included that via a custom code control, using code generated by ChronoForms as a model.
My problem is that, using this technique, Ii can't make the validation 'required' work. Is it possible to modify my script to access the (presumably javascript or mootools) functions that chronoforms uses to force validation required?
I hope this makes sense.
Regards
Nick
Hello NickOg,
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How can I show/hide a textarea when a checkbox is clicked?
P.S: I'm just an automated service๐
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How can I show/hide a textarea when a checkbox is clicked?
P.S: I'm just an automated service๐
Eureka! - went back to the generated code and worked it out. ๐ค
In case anyone else has the same problem, the relevant code is
Once line per form
and then for the check boxes
I am not quite sure where the '1' in
Nick
In case anyone else has the same problem, the relevant code is
Once line per form
<input type="hidden" name="inpPickedCourses" value="" alt="ghost" />
and then for the check boxes
<input type="checkbox" name="inpPickedCourses[]" id="inppickedcourses_0" title="" value="choice 1" class="validate['group[1]']" />
<label for="inppickedcourses_0">Choice 1</label>
<input type="checkbox" name="inpPickedCourses[]" id="inppickedcourses_1" title="" value="choice 2" class="validate['group[1]']" />
<label for="inppickedcourses_1">Choice 2</label>
<input type="checkbox" name="inpPickedCourses[]" id="inppickedcourses_2" title="" value="choice 3" class="validate['group[1]']" />
I am not quite sure where the '1' in
class="validate['group[1]']
comes from - I assumed the sequence number of a group on a form but it doesn't seem to be that.
Nick
What is the opposite of Eureka? ๐ถ ๐ถ
I swear that worked before lunch, It doesn't now and I can't make it. Back to the drawing board and see if I can build the controls in place on a form.
๐
Nick
I swear that worked before lunch, It doesn't now and I can't make it. Back to the drawing board and see if I can build the controls in place on a form.
๐
Nick
Hi Nick,
The "1" is the group identifier, so a group of checkboxes with
You may also change the "1" to assign a checkbox for a different validation group!
Regards,
Max
The "1" is the group identifier, so a group of checkboxes with
validate['group[1]']
will be checked together for at least 1 checked box, a 2nd parameter may increase the limit:
validate['group[1,5]']
You may also change the "1" to assign a checkbox for a different validation group!
Regards,
Max
Still stuck. The code to generate the check box group works fine as per figure included. But I just can't get the validate required to work.
If I include a group check box directly in the form that works fine. If I generate the control using stuff like
then it refuses to validate required on that control or any others added by the wizard to that form.
I suspect that it is because the group number isn't right. I used 32 because the control I added with the wizard was 31. That didn't work so I guessed that after deleting that control it would be 32.
any ideas? Can I find out what the group number is after the first
Nick :?
If I include a group check box directly in the form that works fine. If I generate the control using stuff like
<input type="hidden" name="inpPickedCourses" alt="ghost" value=""/>
foreach ($courseData as $thisCourseRecord) {
....
?>
<input type="checkbox" name="inpPickedCourses[]" <?php echo $allowBooking; ?> class="validate['inpPickedCourses[32]]']"
id="inppickedcourses_<?php echo $courseID; ?>" title="" value="<?php echo $thisCourseRecord["idCourse"]; ?>"
class="validate['group[32]']" />
<?php
....
}
then it refuses to validate required on that control or any others added by the wizard to that form.
I suspect that it is because the group number isn't right. I used 32 because the control I added with the wizard was 31. That didn't work so I guessed that after deleting that control it would be 32.
any ideas? Can I find out what the group number is after the first
<input type="hidden" name="inpPickedCourses" alt="ghost" value=""/>
call?
Nick :?
Hi Nick,
You have 2 class attributes, this is wrong:
Please remove it and try again, the number can be any integer, it doesn't matter!
Regards,
Max
You have 2 class attributes, this is wrong:
class="validate['inpPickedCourses[32]]']"
Please remove it and try again, the number can be any integer, it doesn't matter!
Regards,
Max
Hi Max
My problem now is a but difficult to describe.
I needed to remove a radio box from this form so that the only control on the page is that table described, generated via a PHP script. The thing is that once the radio box has been deleted the validation required for the control generated by the PHP script no longer works. It works fine with the (now redundant) control in place but not without it.
If I add a radio box back into the form then validation of my code works as long as the new radio box has validation required enabled.
Does that make sense? Do you have any suggestions?
Regards
Nick
My problem now is a but difficult to describe.
I needed to remove a radio box from this form so that the only control on the page is that table described, generated via a PHP script. The thing is that once the radio box has been deleted the validation required for the control generated by the PHP script no longer works. It works fine with the (now redundant) control in place but not without it.
If I add a radio box back into the form then validation of my code works as long as the new radio box has validation required enabled.
Does that make sense? Do you have any suggestions?
Regards
Nick
Hi Nick,
Please post the html code for the checkboxes and the radio box!
Regards,
Max
Please post the html code for the checkboxes and the radio box!
Regards,
Max
This topic is locked and no more replies can be posted.