2010-07-13, 20:02:27
How about having special class names that can be used by developers for extra functionality (JavaScript interactivity wise)?
For example have an input and when you click on it a date picker shows? Or <textarea class='rte'></textarea> and you get a rich text editor.
Then with jQuery in document.ready (assuming jQuery UI datepicker and the CKEditor jQuery Adapter are loaded, but can check just in case they are not).
Could also be used for styling purposes as well, i.e. with class 'date' or 'time' the input would be narrower, or class 'widetext' would be full width.
For example have an input
Code:
<input name="event_date" class="date" />
Then with jQuery in document.ready (assuming jQuery UI datepicker and the CKEditor jQuery Adapter are loaded, but can check just in case they are not).
Code:
if($.fn.datepicker) $("input.date").datepicker();
if($.fn.ckeditor) $("textarea.rte").ckeditor();
Could also be used for styling purposes as well, i.e. with class 'date' or 'time' the input would be narrower, or class 'widetext' would be full width.
-- Sam