[pmwiki-devel] adding features to input tags: best practice?
Ben Stallings
Ben at InterdependentWeb.com
Tue Nov 14 11:34:30 CST 2006
Hello again! One of the things I need to do in DataQuery is add some
features to the (:input:) tags... notably, the mask=####-##-## parameter
so that a JavaScript will help people type dates in the right format,
because people can be really quirky about how they type dates otherwise,
and SQL is not at all forgiving.
When I was writing UpdateForm, I got this functionality by creating a
whole other set of markup: (:update:) instead of (:input:). To some
extent I still feel like this was a good decision, since an update field
is substantively different from an input field, in that it pulls
information from a database record.
But ZAPdata uses standard input fields, and this time around I'm trying
to avoid custom markup if I can. So the question becomes, how do I add
features to the (:input:) tag without requiring the user to replace the
forms.php script?
(JM has already produced a form validation recipe at
http://www.johnmichael.de/index.php/Wiki/Forms that does require
replacing the forms.php script. Is this the best approach?)
If InputMarkup() were an object method, I could just extend the object.
But it's a global function, so that's not an option. Should I
redefine the input markup to call a different function? Or is there a
better way that would be more compatible with other form recipes?
Thanks in advance for the feedback!! --Ben S.
More information about the pmwiki-devel
mailing list