In the meantime I was able to discover how the error checking, reporting, and form validating works. It is done in a strange way through package globals, and the error() method.
I would do it in an easier way in place of Alex (however it is working well).
This "highlight the form fields with error" feature is being implemented into my Xtended A.M.D. plugin (XAMD) which enhances the current features (LSQL 2.1.1) of link adding, modifying, deleting.
I solved the problem in the following way:
- duplicated the affected functions (methods)
- changed to pass back hash content containing like Contact_name_error => "error message"
- I solved it by keeping original functionality if this feature is not enabled
pugdog: the add method in GT::SQL::Table gives back id, if add was successful otherwise undef. The real error reporting is done through the error method of GT::Base.
New features already added to Xtended A.M.D. plugin (XAMD):
- Form input fields are generated automatically and are available through tags like: <%Contact_Name%>, or <%Password%>, etc... - implemented for add
- Fully changeable display format of individual error messages, through template: error_form_sub.html. The error messages are inserted through error_message tag - implemented for add
- Changeable individual error message delimiter. Default is "<br>". - implemented for add
- Fully changeable display format of the error table, through template: error_form.html. The error messages are inserted through error_list tag (originally I used the error_table tag, but I decided error_list tag is more descriptive. Please tell me, if you like error_table tag much better). - implemented for add
- Error messages are displayable separately through template tags: <%Contact_Name_error%> or
<%Password_error%>, etc... - almost finished for add, already working
This way you can highlight the input fields where has not correct input this way:
<%if Password%><table border=5 bgcolor="red"><tr><td><%Password%></td></tr></table>
Opinions, comments are always welcome.
Paid Support from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...