1
+ < script type ="text/javascript " src ="state_countryjs.asp "> </ script >
2
+ < script type ="text/javascript " src ="assets/templates/common/js/address_validator.js "> </ script >
3
+ < script type ="text/javascript ">
4
+ useAddressValidator = "[useAddressValidator]" ;
5
+ </ script >
6
+
7
+ < section id ="addAddresses ">
8
+ < h1 class ="page_headers "> [account_Update-Address]</ h1 >
9
+ <!--START: myAccount-->
10
+ < div class ="button right "> < a href ="myaccount.asp " class ="icon-btn icon-btn-prev "> Back to My Account</ a > </ div >
11
+ <!--END: myAccount-->
12
+ < div class ="clear "> </ div >
13
+ <!--START: CATEGORY_HEADER-->
14
+ < div class ="category-header " id ="addAddressesHeader "> [CONTENT]</ div >
15
+ <!--END: CATEGORY_HEADER-->
16
+ < div class ="addUpdateAddress pad10 boxShadow ">
17
+ < form action ="myaccount.asp?action=updateaddress&reqPage=[reqPage]&shipmentid=[shipmentid] " method ="post " name ="checkoutform " id ="checkoutform ">
18
+ < input type ="hidden " name ="tknio " value ="[tknio] ">
19
+ < input type ="hidden " name ="id " value ="[id] " />
20
+ < input type ="hidden " name ="update " value ="1 " />
21
+ <!--START: SAVE_ADDRESSES-->
22
+ < div class ="frmField ">
23
+ < label for ="address_alias "> [account_Address-Alias]</ label >
24
+ < input name ="address_alias " type ="text " id ="address_alias " value ="[address_alias] " size ="25 " tabindex ="1 " class ="txtBoxStyle " />
25
+ <!--START: req_shipping_alias-->
26
+ < img src ="assets/templates/common/images/error2.gif " width ="12 " height ="12 " alt ="" />
27
+ <!--END: req_shipping_alias-->
28
+ < div class ="clear "> </ div >
29
+ </ div >
30
+ <!--END: SAVE_ADDRESSES-->
31
+ < div class ="frmField ">
32
+ < label for ="shipping_firstname "> [CustomerInfo_firstname]</ label >
33
+ < input name ="shipping_firstname " type ="text " id ="shipping_firstname " value ="[shipping_firstname] " size ="15 " tabindex ="2 " class ="txtBoxStyle " />
34
+ <!--START: req_shipping_firstname-->
35
+ < img src ="assets/templates/common/images/error2.gif " width ="12 " height ="12 " alt ="" />
36
+ <!--END: req_shipping_firstname-->
37
+ < div class ="clear "> </ div >
38
+ </ div >
39
+ < div class ="frmField ">
40
+ < label for ="shipping_lastname "> [CustomerInfo_lastname]</ label >
41
+ < input name ="shipping_lastname " type ="text " id ="shipping_lastname " value ="[shipping_lastname] " size ="15 " tabindex ="3 " class ="txtBoxStyle " />
42
+ <!--START: req_shipping_lastname-->
43
+ < img src ="assets/templates/common/images/error2.gif " width ="12 " height ="12 " alt ="" />
44
+ <!--END: req_shipping_lastname-->
45
+ < div class ="clear "> </ div >
46
+ </ div >
47
+ < div class ="frmField ">
48
+ < label for ="shipping_company "> [CustomerInfo_company]</ label >
49
+ < input name ="shipping_company " type ="text " id ="shipping_company " value ="[shipping_company] " size ="25 " tabindex ="4 " class ="txtBoxStyle " />
50
+ < div class ="clear "> </ div >
51
+ </ div >
52
+ < div class ="frmField ">
53
+ < label for =""> [CustomerInfo_phone]</ label >
54
+ < input name ="shipping_phone " type ="text " id ="shipping_phone " value ="[shipping_phone] " size ="25 " tabindex ="5 " class ="txtBoxStyle " />
55
+ <!--START: req_shipping_phone-->
56
+ < img src ="assets/templates/common/images/error2.gif " width ="12 " height ="12 " alt ="" />
57
+ <!--END: req_shipping_phone-->
58
+ < div class ="clear "> </ div >
59
+ </ div >
60
+ < div class ="frmField ">
61
+ < label for ="shipping_address "> [CustomerInfo_address]</ label >
62
+ < input name ="shipping_address " type ="text " id ="shipping_address " value ="[shipping_address] " size ="25 " tabindex ="6 " class ="txtBoxStyle " />
63
+ <!--START: req_shipping_address-->
64
+ < img src ="assets/templates/common/images/error2.gif " width ="12 " height ="12 " alt ="" />
65
+ <!--END: req_shipping_address-->
66
+ < div class ="clear "> </ div >
67
+ </ div >
68
+ < div class ="frmField ">
69
+ < label for ="shipping_address2 "> [CustomerInfo_address2]</ label >
70
+ < input name ="shipping_address2 " type ="text " id ="shipping_address2 " value ="[shipping_address2] " size ="25 " tabindex ="7 " class ="txtBoxStyle " />
71
+ < div class ="clear "> </ div >
72
+ </ div >
73
+ < div class ="frmField ">
74
+ < label for ="shipping_city "> [CustomerInfo_city]</ label >
75
+ < input name ="shipping_city " type ="text " id ="shipping_city " value ="[shipping_city] " size ="25 " tabindex ="8 " class ="txtBoxStyle " />
76
+ <!--START: req_shipping_city-->
77
+ < img src ="assets/templates/common/images/error2.gif " width ="12 " height ="12 " alt ="" />
78
+ <!--END: req_shipping_city-->
79
+ < div class ="clear "> </ div >
80
+ </ div >
81
+ < div class ="frmField ">
82
+ < label for =""> [CustomerInfo_country]</ label >
83
+ < select id ='shipping_country ' name ='shipping_country ' onchange ="populateState('shipping_state','shipping_country'); " tabindex ="9 " class ="txtBoxStyle ">
84
+ </ select >
85
+ <!--START: req_shipping_country-->
86
+ < img src ="assets/templates/common/images/error2.gif " width ="12 " height ="12 " alt ="" />
87
+ <!--END: req_shipping_country-->
88
+ < div class ="clear "> </ div >
89
+ </ div >
90
+ < div class ="frmField ">
91
+ < label for ="shipping_state "> [CustomerInfo_state]</ label >
92
+ < select id ="shipping_state " name ="shipping_state " tabindex ="10 " class ="txtBoxStyle ">
93
+ </ select >
94
+ <!--START: req_shipping_state-->
95
+ < img src ="assets/templates/common/images/error2.gif " width ="12 " height ="12 " alt ="" />
96
+ <!--END: req_shipping_state-->
97
+ < div class ="clear "> </ div >
98
+ </ div >
99
+ < div class ="frmField ">
100
+ < label for ="shipping_zip "> [CustomerInfo_zip]</ label >
101
+ < input name ="shipping_zip " type ="text " id ="shipping_zip " value ="[shipping_zip] " size ="10 " tabindex ="11 " class ="txtBoxStyle " />
102
+ <!--START: req_shipping_zip-->
103
+ < img src ="assets/templates/common/images/error2.gif " width ="12 " height ="12 " alt ="" />
104
+ <!--END: req_shipping_zip-->
105
+ < div class ="clear "> </ div >
106
+ </ div >
107
+ <!--START: addressType-->
108
+ < div class ="frmField ">
109
+ < label for ="shipping_addresstype "> [CustomerInfo_address_type]</ label >
110
+ < select name ="shipping_addresstype " id ="shipping_addresstype " class ="txtBoxStyle ">
111
+ [addressTypeDropDown]
112
+ </ select >
113
+ < div class ="clear "> </ div >
114
+ </ div >
115
+ <!--END: addressType-->
116
+ < div class ="back-add-address-button ">
117
+ < input type ="button " name ="back " onclick ="javascript:history.back(1); " value ="Back " class ="btn " onmouseover ="this.className='btn_over' " onmouseout ="this.className='btn' " id ="Submit1 "/>
118
+ < input type ="button " onclick ="javascript:doAddAddress(this.form); " value ="[account_Update-Address] " class ="btn " onmouseover ="this.className='btn_over' " onmouseout ="this.className='btn' " />
119
+ </ div >
120
+ < div class ="clear "> </ div >
121
+ </ form >
122
+ </ div >
123
+ < div class ="clear "> </ div >
124
+ <!--START: CATEGORY_FOOTER-->
125
+ < div class ="category-footer " id ="addAddressesFooter "> [CONTENT]</ div >
126
+ <!--END: CATEGORY_FOOTER-->
127
+ </ section >
128
+
129
+ < input type ="hidden " name ="hdnAddrressValidatorResult " id ="hdnAddrressValidatorResult " value ="" />
130
+ < div id ="divAddrressValidator " style ="display:none; ">
131
+ <!--START: AddressValidatorBlock-->
132
+ < div style ="background-color: #FFF; padding: 30px; ">
133
+ <!--START: AddressValidatorBlock_ValidationFailed-->
134
+ < div > [result_msg]</ div >
135
+ <!--END: AddressValidatorBlock_ValidationFailed-->
136
+ <!--START: AddressValidatorBlock_ValidationSuggestion-->
137
+ < div > [result_msg]
138
+ <!--START: AddressValidatorBlock_ValidationSuggestion_SingleAddressBlock-->
139
+ < br />
140
+ < br />
141
+ < strong > [checkout1_AddressValidator_SuggestedAddress]</ strong > < a style ="text-decoration:underline; " href ="javascript:void(0); " onclick ="javascript:selectAddress('[AddrressValidator_address1]', '[AddrressValidator_address2]', '[AddrressValidator_city]', '[AddrressValidator_state]', '[AddrressValidator_zip]', 'shipping_address', 'shipping_address2', 'shipping_city', 'shipping_state', 'shipping_zip');doAddAddress(document.checkoutform); "> [AddrressValidator_address], [AddrressValidator_city], [AddrressValidator_state], [AddrressValidator_zip]</ a >
142
+ <!--END: AddressValidatorBlock_ValidationSuggestion_SingleAddressBlock-->
143
+ </ div >
144
+ <!--END: AddressValidatorBlock_ValidationSuggestion-->
145
+ <!--START: AddressValidatorBlock_ValidationSuggestion_ContinueWithEnteredAddress-->
146
+ < br />
147
+ < a style ="text-decoration:underline; " href ="javascript:void(0); " onclick ="javascript:addressValidatorContinue('[AddrressValidator_addresstype]'); "> [checkout1_AddressValidator_Continue]</ a > < br />
148
+ <!--END: AddressValidatorBlock_ValidationSuggestion_ContinueWithEnteredAddress-->
149
+ < br />
150
+ < a style ="text-decoration:underline; " href ="javascript:void(0); " onclick ="javascript:closeAddressValidatorModal(); "> < i class ="icon-cancel "> </ i > [checkout1_AddressValidator_Close]</ a > </ div >
151
+ <!--END: AddressValidatorBlock-->
152
+ </ div >
153
+
154
+ < script type ="text/javascript ">
155
+ initCountry ( '[shipping_country]' , '[shipping_state]' , 'shipping_state' , 'shipping_country' ) ;
156
+ </ script >
157
+ < script type ="text/javascript ">
158
+
159
+ function doAddAddress ( objForm ) {
160
+
161
+ //You should create the validator only after the definition of the HTML form
162
+ var frmvalidator = new Validator ( "checkoutform" ) ;
163
+
164
+ frmvalidator . setAddnlValidationFunction ( "submitForm" ) ;
165
+
166
+ frmvalidator . addValidation ( "address_alias" , "req" , "Please enter a address alias. Example: My address" ) ;
167
+ frmvalidator . addValidation ( "address_alias" , "maxlen=25" , "Max length for Shipping Alias is 25" ) ;
168
+
169
+
170
+ frmvalidator . addValidation ( "shipping_firstname" , "req" , "Please enter your First Name" ) ;
171
+ frmvalidator . addValidation ( "shipping_firstname" , "maxlen=20" , "Max length for First Name is 20" ) ;
172
+
173
+
174
+ frmvalidator . addValidation ( "shipping_lastname" , "req" , "Please enter your Last Name" ) ;
175
+ frmvalidator . addValidation ( "shipping_lastname" , "maxlen=20" , "Max length for Last Name is 20" ) ;
176
+
177
+
178
+ frmvalidator . addValidation ( "shipping_phone" , "maxlen=18" , "Max length for Phone is 18" ) ;
179
+ frmvalidator . addValidation ( "shipping_phone" , "req" , "Please enter your phone" ) ;
180
+
181
+ frmvalidator . addValidation ( "shipping_address" , "maxlen=50" , "Max length for Address is 50" ) ;
182
+ frmvalidator . addValidation ( "shipping_address" , "req" , "Please enter your address" ) ;
183
+
184
+ frmvalidator . addValidation ( "shipping_address2" , "maxlen=40" , "Max length for Suite/Apt# is 40" ) ;
185
+
186
+ frmvalidator . addValidation ( "shipping_city" , "maxlen=50" , "Max length for City is 50" ) ;
187
+ frmvalidator . addValidation ( "shipping_city" , "req" , "Please enter your City" ) ;
188
+
189
+ frmvalidator . addValidation ( "shipping_country" , "maxlen=50" ) ;
190
+ frmvalidator . addValidation ( "shipping_country" , "req" , 0 ) ;
191
+
192
+ frmvalidator . addValidation ( "shipping_state" , "maxlen=50" , "Max length for State is 50" ) ;
193
+ frmvalidator . addValidation ( "shipping_state" , "req" , 0 ) ;
194
+
195
+ frmvalidator . addValidation ( "shipping_zip" , "maxlen=15" , "Max length for Zip is 15" ) ;
196
+ frmvalidator . addValidation ( "shipping_zip" , "req" , "Please enter your zip code" ) ;
197
+
198
+ var company = get_Element ( 'shipping_company' ) . value ;
199
+ var address1 = get_Element ( 'shipping_address' ) . value ;
200
+ var address2 = get_Element ( 'shipping_address2' ) . value ;
201
+ var city = get_Element ( 'shipping_city' ) . value ;
202
+ var state = get_Element ( 'shipping_state' ) . value ;
203
+ var country = get_Element ( 'shipping_country' ) . value ;
204
+ var zip = get_Element ( 'shipping_zip' ) . value ;
205
+
206
+ if ( useAddressValidator == "1" && country == "US" ) {
207
+ verify_address ( address1 , address2 , city , state , country , zip , company , 'addressbook' ) ;
208
+ }
209
+ else {
210
+ objForm . submit ( ) ;
211
+ }
212
+ }
213
+
214
+ function submitCheckoutFormPos ( ) {
215
+ objForm = document . checkoutform ;
216
+ if ( jQuery ( "#hdnAddrressValidatorResult" ) . val ( ) == "1" ) {
217
+ objForm . submit ( ) ;
218
+ return ;
219
+ }
220
+ else {
221
+ jQuery ( "#divAddrressValidator" ) . modal ( { containerCss : { borderWidth : '1px' , width : '602px' , height : '212px' } } ) ;
222
+ document . body . style . cursor = '' ;
223
+ }
224
+ }
225
+
226
+ function addressValidatorContinue ( type ) {
227
+ useAddressValidator = '' ;
228
+ doAddAddress ( document . checkoutform ) ;
229
+ jQuery . modal . close ( ) ;
230
+ }
231
+ </ script >
0 commit comments