Re: validate select field in a Model

2012-11-01 Thread Chris
thanks chetan,... ! it works ...! no empty spots,... On Thursday, November 1, 2012 10:04:38 AM UTC-7, chetan varshney wrote: > > use like this > > echo $this->Form->input("gender" , array('type' => 'select', > 'options'=>$genders))?> > > good luck all set > > On Thu, Nov 1, 2012 at 10:16 PM, Ch

Re: validate select field in a Model

2012-11-01 Thread Chetan Varshney
use like this echo $this->Form->input("gender" , array('type' => 'select', 'options'=>$genders))?> good luck all set On Thu, Nov 1, 2012 at 10:16 PM, Chris wrote: > thanks chetan,... I have tried that too,... no luck,... steel having empty > spots on top of options,... please take a look of i

Re: validate select field in a Model

2012-11-01 Thread Chris
thanks chetan,... I have tried that too,... no luck,... steel having empty spots on top of options,... please take a look of it,... http://www.hamayk.com/signup I have remove 'unknown' On Thursday, November 1, 2012 5:47:04 AM UTC-7, chetan varshney wrote: > > The logic you are trying to use

Re: validate select field in a Model

2012-11-01 Thread Chris
hi jsundquist,... in fact I'm getting an 2 empty spots on top with no options empty,... what if the new user who's trying to signup accidentally deselect it ? ,... and there we need the red wrapping warning with message,... 'message' => 'Gender must be valid',... anyway,... for now I'm validat

Re: validate select field in a Model

2012-11-01 Thread Chetan Varshney
The logic you are trying to use it produce html as- unknown male female So you should use in following way- Configure::write('User.genders', array(''=>'unknown', '1'=>'male', '2'=>'female')); rest code is same On Thu, Nov 1, 2012 at 3:53 PM, Chris wrote: > > hi guys,... I'm using cake 1.3

Re: validate select field in a Model

2012-11-01 Thread Jonathan Sundquist
A select dropdown will never be empty unless one of the options is an empty string. - Jon On Nov 1, 2012 5:23 AM, "Chris" wrote: > > hi guys,... I'm using cake 1.3 > how can I validate "select" field from Model,? > > what I have in bootstrap: > Configure::write('User.genders', array('unknow

Re: validate select field in a Model

2012-11-01 Thread Jonathan Sundquist
- Jon On Nov 1, 2012 5:23 AM, "Chris" wrote: > > hi guys,... I'm using cake 1.3 > how can I validate "select" field from Model,? > > what I have in bootstrap: > Configure::write('User.genders', array('unknown', 'male', 'female')); > > in a view: > > > $genders = array(Configu