Totally Zenned
- Join Date:
- Aug 2007
- Location:
- Gijón, Asturias, Spain
- Posts:
- 2,872
- Plugin Contributions:
- 7
Javascript validation of extra field in create edit account
Hi,
I need some pointers regarding Javascript validation.
I have added a tax id field to the create and edit account pages. I wish to validate this field.
Using edit account for illustration purposes the core javascript validation routine is
\includes\modules\pages\account_edit\jscript_form_check.php
I have added my routine in the same folder
\includes\modules\pages\account_edit\jscript_form_check_NIF.php
This is being included and is validating correctly but I have had to modify the core file jscript_form_check.php to call this extra routine during the form validation.
check_dni("taxid", <?php echo ENTRY_TAXID_NUMBER_LENGTH; ?>, "<?php echo ENTRY_TAXID_NUMBER_ERROR; ?>");
In the interests of code-elegance/education, is it possible to call this extra routine WITHOUT modifying the core code jscript_form_check.php?
If so how? I am an educated cut-and-paste trial-and-error coder and not much more, so be gentle.
Regards
Steve