SHOW:
|
|
- or go back to the newest paste.
1 | <script type="text/javascript" src="%%GLOBAL_ShopPath%%/javascript/formfield.js?%%GLOBAL_JSCacheToken%%"></script> | |
2 | <script type="text/javascript" src="%%GLOBAL_ShopPath%%/javascript/validate.js?%%GLOBAL_JSCacheToken%%"></script> | |
3 | <script type="text/javascript"><!-- | |
4 | ||
5 | /* Make sure all new account details are filled in */ | |
6 | function check_create_account_form() { | |
7 | ||
8 | var formIdx = [%%GLOBAL_CreateAccountAccountFormFieldID%%, %%GLOBAL_CreateAccountShippingFormFieldID%%]; | |
9 | var emailField, passwordField, confirmField, formfields; | |
10 | ||
11 | for (var i=0; i<formIdx.length; i++) { | |
12 | formfields = FormField.GetValues(formIdx[i]); | |
13 | ||
14 | for (var j=0; j<formfields.length; j++) { | |
15 | var rtn = FormField.Validate(formfields[j].field); | |
16 | ||
17 | if (!rtn.status) { | |
18 | alert(rtn.msg); | |
19 | FormField.Focus(formfields[j].field); | |
20 | return false; | |
21 | } | |
22 | ||
23 | if (formIdx[i] == %%GLOBAL_CreateAccountAccountFormFieldID%%) { | |
24 | if (formfields[j].privateId == 'EmailAddress') { | |
25 | emailField = formfields[j]; | |
26 | } else if (formfields[j].privateId == 'Password') { | |
27 | passwordField = formfields[j]; | |
28 | } else if (formfields[j].privateId == 'ConfirmPassword') { | |
29 | confirmField = formfields[j]; | |
30 | } | |
31 | } | |
32 | } | |
33 | } | |
34 | ||
35 | if (!isValidEmailAddress(emailField.value)) { | |
36 | alert("%%LNG_AccountEnterValidEmail%%"); | |
37 | FormField.Focus(emailField.field); | |
38 | return false; | |
39 | } | |
40 | ||
41 | if(passwordField.value == "") { | |
42 | alert("%%LNG_AccountEnterPassword%%"); | |
43 | FormField.Focus(passwordField.field); | |
44 | FormField.Focus(passwordField.field); | |
45 | return false; | |
46 | } | |
47 | ||
48 | if((passwordField.value != "" || confirmField.value != "") && (passwordField.value != confirmField.value)) { | |
49 | alert("%%LNG_AccountPasswordsDontMatch%%"); | |
50 | FormField.Focus(confirmField.field); | |
51 | return false; | |
52 | } | |
53 | ||
54 | return true; | |
55 | } | |
56 | ||
57 | - | %%GLOBAL_FormFieldRequiredJS%% |
57 | + | |
58 | lang.CustomFieldsValidationRequired ="השדה '%s' הינו שדה חובה"; | |
59 | lang.CustomFieldsValidationOptionRequired = "Please choose an option for the '%s' field."; | |
60 | lang.CustomFieldsValidationNumbersOnly = "The '%s' field must only contain numbers."; | |
61 | lang.CustomFieldsValidationNumbersToLow = "The '%s' field cannot be lower than %d."; | |
62 | lang.CustomFieldsValidationNumbersToHigh = "The '%s' field cannot be higher than %d."; | |
63 | lang.CustomFieldsValidationDateToLow = "The '%s' field cannot be before %s."; | |
64 | lang.CustomFieldsValidationDateToHigh = "The '%s' field cannot be after %s."; | |
65 | lang.CustomFieldsValidationDateInvalid = "The '%s' field, if in use, must have all the date fields selected."; | |
66 | ||
67 | $(document).ready( | |
68 | function() | |
69 | { | |
70 | $(FormField.GetField(11)).live("change", {"fieldId":11,"countryId":11,"stateId":12}, FormFieldEvent.SingleSelectPopulateStates); | |
71 | } | |
72 | ); | |
73 | //--> | |
74 | </script> | |
75 | |