For many of our web applications, we utilize the Yii Framework extensively. A great feature of the framework is the CActiveForm, which allows you to link up your Model to your View in a very easy manner. (See Model-View-Controller Architecture on Wikipedia for a good explanation of this concept.)
If you also use the Yii Framework, you might find yourself in a dilemma that we recently experienced. We had a date field on our form, and wanted to use the CJuiDatePicker widget so that users get a nifty dropdown where they can select a date. We also wanted to link it to the model, defaulting it to the field in our database if there was already an instance of the object. Most Yii widgets only need you to link up with the ‘model’ option, but CJuiDatePicker is different. To default the value, the ‘value’ line below must be used.
Do you know of other ways to accomplish this? Let us know in the comments!