Author: mor
Date: Fri Sep 11 10:33:19 2009 New Revision: 813765 URL: http://svn.apache.org/viewvc?rev=813765&view=rev Log: Misc. improvements. Thanks Deepak Dixit for implementation. Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/customer/newcustomer.ftl Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/customer/newcustomer.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/customer/newcustomer.ftl?rev=813765&r1=813764&r2=813765&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/customer/newcustomer.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/customer/newcustomer.ftl Fri Sep 11 10:33:19 2009 @@ -25,35 +25,35 @@ lastFocusedName = formElement.name; } function clickUsername() { - if (document.forms["newuserform"].elements["UNUSEEMAIL"].checked) { + if ($('UNUSEEMAIL').checked) { if (lastFocusedName == "UNUSEEMAIL") { - document.forms["newuserform"].elements["PASSWORD"].focus(); + $('PASSWORD').focus(); } else if (lastFocusedName == "PASSWORD") { - document.forms["newuserform"].elements["UNUSEEMAIL"].focus(); + $('UNUSEEMAIL').focus(); } else { - document.forms["newuserform"].elements["PASSWORD"].focus(); + $('PASSWORD').focus(); } } } function changeEmail() { - if (document.forms["newuserform"].elements["UNUSEEMAIL"].checked) { - document.forms["newuserform"].elements["USERNAME"].value=document.forms["newuserform"].elements["CUSTOMER_EMAIL"].value; + if ($('UNUSEEMAIL').checked) { + $('USERNAME').value = $F('CUSTOMER_EMAIL'); } } function setEmailUsername() { - if (document.forms["newuserform"].elements["UNUSEEMAIL"].checked) { - document.forms["newuserform"].elements["USERNAME"].value=document.forms["newuserform"].elements["CUSTOMER_EMAIL"].value; - // don't disable, make the browser not submit the field: document.forms["newuserform"].elements["USERNAME"].disabled=true; + if ($('UNUSEEMAIL').checked) { + $('USERNAME').value = $F('CUSTOMER_EMAIL'); + // don't disable, make the browser not submit the field: $('USERNAME').disabled=true; } else { - document.forms["newuserform"].elements["USERNAME"].value=''; - // document.forms["newuserform"].elements["USERNAME"].disabled=false; + $('USERNAME').value=''; + // $('USERNAME').disabled=false; } } function hideShowUsaStates() { - if (document.getElementById("customerCountry").value == "USA" || document.getElementById("customerCountry").value == "UMI") { - document.getElementById("customerState").style.display = "block"; + if ($('customerCountry').value == "USA" || $('customerCountry').value == "UMI") { + $('customerState').style.display = "block"; } else { - document.getElementById("customerState").style.display = "none"; + $('customerState').style.display = "none"; } } //]]> @@ -93,7 +93,7 @@ </#if> </#macro> -<form method="post" action="<@ofbizUrl>createcustomer${previousParams}</@ofbizUrl>" name="newuserform"> +<form method="post" action="<@ofbizUrl>createcustomer${previousParams}</@ofbizUrl>" id="newuserform"> <#---------------------------------------------------------------------- @@ -390,12 +390,12 @@ button actions. -------------------------------------------------------------------------------> <div class="buttons"> - <a href="javascript:document.newuserform.submit()">${uiLabelMap.CommonSave}</a> + <a href="javascript:$('newuserform').submit()">${uiLabelMap.CommonSave}</a> <a href="<@ofbizUrl>checkLogin/main</@ofbizUrl>" class="reset">${uiLabelMap.CommonBack}</a> </div> <script type="text/javascript"> //<![CDATA[ - hideShowUsaStates(); + hideShowUsaStates(); //]]> </script> \ No newline at end of file |
Free forum by Nabble | Edit this page |