[Vtigercrm-commits] [vtiger-commits] r5691 - /vtigercrm/trunk/modules/Users/Forms.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Wed May 3 03:58:59 EDT 2006
Author: saraj
Date: Wed May 3 01:58:55 2006
New Revision: 5691
Log:
Added validation for UserEditView - Ahmed
Modified:
vtigercrm/trunk/modules/Users/Forms.php
Modified: vtigercrm/trunk/modules/Users/Forms.php
==============================================================================
--- vtigercrm/trunk/modules/Users/Forms.php (original)
+++ vtigercrm/trunk/modules/Users/Forms.php Wed May 3 01:58:55 2006
@@ -74,11 +74,11 @@
return false;
}
if (trim(form.email1.value) != "" && !/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(form.email1.value)) {
- alert('"' + form.email1.value + '" $err_invalid_email_address');
+ alert('"' + form.email1.value + '" is $err_invalid_email_address');
return false;
}
if (trim(form.email2.value) != "" && !/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(form.email2.value)) {
- alert('"' + form.email2.value + '" $err_invalid_email_address');
+ alert('"' + form.email2.value + '" value in other email field is $err_invalid_email_address');
return false;
}
if(trim(form.new_password.value) != trim(form.confirm_new_password.value))
@@ -97,4 +97,67 @@
return $the_script;
}
+function get_validate_record_js1 () {
+global $mod_strings;
+global $app_strings;
+
+$lbl_last_name = $mod_strings['LBL_LIST_LAST_NAME'];
+$lbl_user_name = $mod_strings['LBL_LIST_USER_NAME'];
+$lbl_new_password = $mod_strings['LBL_LIST_PASSWORD'];
+$lbl_confirm_new_password = $mod_strings['LBL_LIST_CONFIRM_PASSWORD'];
+$lbl_user_email1 = $mod_strings['LBL_LIST_EMAIL'];
+$err_missing_required_fields = $app_strings['ERR_MISSING_REQUIRED_FIELDS'];
+$err_invalid_email_address = $app_strings['ERR_INVALID_EMAIL_ADDRESS'];
+
+$the_script = <<<EOQ
+
+<script type="text/javascript" language="Javascript">
+<!-- to hide script contents from old browsers
+
+function verify_data(form) {
+ var isError = false;
+ var errorMessage = "";
+ if (trim(form.user_name.value) == "") {
+ isError = true;
+ errorMessage += "\\n$lbl_user_name";
+ }
+ if (trim(form.last_name.value) == "") {
+ isError = true;
+ errorMessage += "\\n$lbl_last_name";
+ }
+ if (trim(form.email1.value) == "") {
+ isError = true;
+ errorMessage += "\\n$lbl_user_email1";
+ }
+
+ if (isError == true) {
+ alert("$err_missing_required_fields" + errorMessage);
+ return false;
+ }
+ if (trim(form.email1.value) != "" && !/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(form.email1.value)) {
+ alert('"' + form.email1.value + '" is $err_invalid_email_address');
+ return false;
+ }
+ if (trim(form.email2.value) != "" && !/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(form.email2.value)) {
+ alert('"' + form.email2.value + '" value in other email field is $err_invalid_email_address');
+ return false;
+ }
+ if(trim(form.new_password.value) != trim(form.confirm_new_password.value))
+ {
+ alert("The password does't match");
+ return false;
+ }
+ return true;
+}
+
+// end hiding contents from old browsers -->
+</script>
+
+EOQ;
+
+return $the_script;
+}
+
+
+
?>
More information about the vtigercrm-commits
mailing list