Yii Framework Forum: validating generated textfield in a model - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

validating generated textfield in a model

#1 User is offline   darwin15 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 27-January 15

Posted 28 January 2015 - 09:16 PM

hello,

please help me with this:

i have data in database that will be display in the view using foreach. oneof the data will be represented by a textfield.......this textfield has a name of duration[]-(this is an array)... all i want to know is how this textfield validated in a model.

note: i used chtml::textfield
0

#2 User is offline   Fabrizio Caldarelli 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,058
  • Joined: 21-March 13
  • Location:Rome, Italy

Posted 29 January 2015 - 05:34 AM

Have you set validation rules in your model?
Yii2 by example: my book about Yii2
https://www.packtpub...nt/yii2-example
0

#3 User is offline   darwin15 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 27-January 15

Posted 01 February 2015 - 08:01 PM

View PostFabrizio Caldarelli, on 29 January 2015 - 05:34 AM, said:

Have you set validation rules in your model?





yes but the duration[] is an array. in my model duration is only one. maybe i think the duration[] can't recognize by the model
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users