Author: mor
Date: Tue Sep 16 02:29:14 2008 New Revision: 695785 URL: http://svn.apache.org/viewvc?rev=695785&view=rev Log: Client side validation on Account Information section of new customer page. Contribution from Rishi Solanki. Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js ofbiz/trunk/applications/ecommerce/widget/CustomerScreens.xml Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl?rev=695785&r1=695784&r2=695785&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl Tue Sep 16 02:29:14 2008 @@ -56,11 +56,13 @@ </div> <div class="form-row"> <div class="field-label"><label for="password">${uiLabelMap.CommonPassword}* <span id="advice-required-password" style="display: none" class="errorMessage">(required)</span></label></div> - <div><input type="password" name="password" id="password" class="required" value="${parameters.password?if_exists}" maxlength="16"></div> + <div><input type="password" name="password" id="password" class="required validate-password" value="${parameters.password?if_exists}" maxlength="16"></div> + <span id="advice-validate-password-password" class="errorMessage" style="display:none">${uiLabelMap["loginservices.password_may_not_equal_username"]}</span> </div> <div class="form-row"> <div class="field-label"><label for="passwordVerify">${uiLabelMap.PartyRepeatPassword}* <span id="advice-required-passwordVerify" style="display: none" class="errorMessage">(required)</span></label></div> - <div><input type="password" name="passwordVerify" id="passwordVerify" class="required" value="${parameters.passwordVerify?if_exists}" maxlength="16"></div> + <div><input type="password" name="passwordVerify" id="passwordVerify" class="required validate-passwordVerify" value="${parameters.passwordVerify?if_exists}" maxlength="16"></div> + <span id="advice-validate-passwordVerify-passwordVerify" class="errorMessage" style="display:none">${uiLabelMap["loginservices.password_did_not_match_verify_password"]}</span> </div> </div> </div> Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js?rev=695785&r1=695784&r2=695785&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js (original) +++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js Tue Sep 16 02:29:14 2008 @@ -4,6 +4,7 @@ Event.observe(window, 'load', function() { if ($('newUserForm')) { validateNewUser = new Validation('newUserForm', {immediate: true, onSubmit: false}); + addValidations(); Event.observe($('emailAddress'), 'change', setUserNameFromEmail); Event.observe('useShippingAddressForBilling', 'click', useShippingAddressAsBillingToggle); Event.observe($('submitNewUserForm'), 'click', submitValidNewUser); @@ -336,4 +337,15 @@ Event.stopObserving($('shipToStateProvinceGeoId'), 'change', ""); Event.stopObserving($('shipToCountryGeoId'), 'change', ""); Event.stopObserving($('shipToPostalCode'), 'change', ""); +} + +function addValidations() { + Validation.add('validate-password', "", { + minLength : 5, + notOneOf : ['password','PASSWORD'], + notEqualToField : 'username' + }); + Validation.add('validate-passwordVerify', "", { + equalToField : 'password' + }); } \ No newline at end of file Modified: ofbiz/trunk/applications/ecommerce/widget/CustomerScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/widget/CustomerScreens.xml?rev=695785&r1=695784&r2=695785&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/widget/CustomerScreens.xml (original) +++ ofbiz/trunk/applications/ecommerce/widget/CustomerScreens.xml Tue Sep 16 02:29:14 2008 @@ -522,6 +522,7 @@ <section> <actions> <property-map resource="MarketingUiLabels" map-name="uiLabelMap" global="true"/> + <property-map resource="SecurityextUiLabels" map-name="uiLabelMap" global="true"/> <set field="titleProperty" value="PageTitleNewCustomer"/> <set field="layoutSettings.javaScripts[]" value="/ecommerce/images/profile.js" global="true"/> </actions> |
Free forum by Nabble | Edit this page |