It is currently Wed Feb 08, 2012 5:23 pm

All times are UTC + 2 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: HTML_Quickform custom rule for grouped checkboxes...
PostPosted: Thu Oct 02, 2008 8:23 am 
Offline

Joined: Thu Oct 02, 2008 8:16 am
Posts: 1
Hello all, Bellow is a portion of code that I need help with:

$chkboxtype[] = &HTML_QuickForm::createElement('checkbox', '1', null, 'Hearing Impaired');
$chkboxtype[] = &HTML_QuickForm::createElement('checkbox', '2', null, 'Visual Impaired');
$chkboxtype[] = &HTML_QuickForm::createElement('checkbox', '3', null, 'Mental Health');
$chkboxtype[] = &HTML_QuickForm::createElement('checkbox', '4', null, 'Assisted Living');
$chkboxtype[] = &HTML_QuickForm::createElement('checkbox', '5', null, 'Independent Living');

$form->addGroup($chkboxtype, 'chkboxtype', 'Type:');

$rule['0'][] = array('Please select at least one type!', 'required');
$form->addGroupRule('chkboxtype', $rule);

The addGroupRule above works perfectly but, only half the battle with what I'm trying to do. I do not want to validate each individual checkbox element. How do I check and make sure one of the check boxes are selected and if not output "Please select at least one type!"

-Thanks,
Rich


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 31, 2010 6:51 pm 
Offline

Joined: Mon Apr 05, 2010 5:28 pm
Posts: 19
Pleae describe it I am unable to understand it.

_________________
Pranic Healing India | Know the media
Best Astrology Solutions
vaastu Tips


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 2 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to: