cake 1.2 check boxes

2007-05-08 Thread roliver

I'm using 1.2 the lastest alpha(not from SVN) Which class should I use
to create a checkbox that can be validated by the model?  I'm also
using the validation class in 1.2 what is the best method to validate
it?

I'm currently using the following to generate the check box in the
view:

$form-input('Application/terms_conditions', array('type'='checkbox',
'label'='I have read, understand and agree to Artspan\'s a
href=#Terms and Conditions/a'))

This renders the check box okay, but I'm having trouble validating
that the user must check it before the can save successfully

I would greatly appreciate any insight.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: cake 1.2 check boxes

2007-05-08 Thread Mariano Iglesias

In 1.2 Model/field notation is deprecated in favor of Model.field.

So what you have in the view should be:

?php echo $form-input('Application.terms_conditions', array(
'type'='checkbox', 
'label'='I have read, understand and agree to Artspan\'s a
href=#Terms and Conditions/a',
'error' = 'You must agree to our Terms and Conditions'
)); ?

Then on your Application model you should have this validation defined at
least:

var $validate = array(
'terms_conditions' = '/1/'
);

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de roliver
Enviado el: Martes, 08 de Mayo de 2007 10:34 p.m.
Para: Cake PHP
CC: [EMAIL PROTECTED]
Asunto: cake 1.2 check boxes

I'm using 1.2 the lastest alpha(not from SVN) Which class should I use
to create a checkbox that can be validated by the model?  I'm also
using the validation class in 1.2 what is the best method to validate
it?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---