When I submit the form what is the correct approach to take these 3 values and convert them into a single value to be used in the birthday attribute?
Incidentally I’ve seen the jquery date control is available but I don’t like the user experience for selecting a birthday via a calendar widget. I’d prefer to stay with the 3 lists ala Digg.
Also, you can add month, day, year fields to your model and some rules for them (to be integer only, for example). But don’t forget to set them “safe”.
Ah ok. I’d done setAttribute because I was following some example code where it does this in the controller for a “register” scenario:
$form->attributes=$_POST['User'];
I appreciate that does a mass update but I assumed it was still necessary to use setAttribute to set individual model attributes as well. Also when debugging the model doesn’t appear to have an explicit birthday attribute so I thought going your route would cause an error - obviously it doesn’t!.