Re: client-side templates?
Posted: Mon Mar 23, 2009 1:13 pm
Yes. In practice it is mainly form selects, radio buttons and checkboxes that need to be rendered like this. They are pretty unique among HTML elements. A lot of form rendering annoyance is because of these three types of elements. Passing JSON with the element name, the values, labels and selected values simplifies the problem, because like other form elements you are only rendering data from the Model.
I have not found a good set of Javascript renderers though. The jQuery solutions I have found are overkill. I have done little hack functions. Really this should be a little Javascript library that works in conjunction with a PHP forms library.
I have not found a good set of Javascript renderers though. The jQuery solutions I have found are overkill. I have done little hack functions. Really this should be a little Javascript library that works in conjunction with a PHP forms library.