Yii Framework Forum: Change elements names dynamically - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Change elements names dynamically

#1 User is offline   gans 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 12-December 11

Posted 13 December 2011 - 03:05 AM

Hello Everyone..

I am new to Yii. My requirement is that i have created widget for adding addresses. Over there i have written jquery clone method for cloning the address div.
My requirement is when clone the address div, it will add the counter in front of label i.e Address 1, Address 2...
But in my model class i have set attribute label for address. So how can i manage it in Yii?

Thanks in advanc
0

#2 User is offline   mastermunj 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • Joined: 12-July 11

Posted 23 January 2012 - 03:42 AM

You could have a model "Address" and have a HAS_MANY relation. Thus rendering and validating will also not be a problem.

Moreover, Address 1 & Address 2 & so on can be generated by keeping a counter.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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