Results 1 to 2 of 2

Thread: password and confirm password

  1. #1

    Default password and confirm password

    I have this in my create.jspx

    I have the following fields

    Code:
    <field:input field="password" id="a_pwd" required="true" type="password" z="user-managed"/>
     <field:input field="confirm_password" id="z_c_pwd" required="true" type="password" z="user-managed" disableFormBinding="true"/>
    and this validation logic.. I intend to replace the alert with Spring.addDecoration. However this is not working... Any ideas...

    Code:
    <c:set var="sec_password">
               <spring:escapeBody javaScriptEscape="true" >${password}</spring:escapeBody>
            </c:set>
            <c:set var="sec_confirm_password">
               <spring:escapeBody javaScriptEscape="true" >${confirm_password}</spring:escapeBody>
            </c:set>
            
            <c:if test="${sec_password} != ${sec_confirm_password}">
            	<script type="text/javascript">
            		alert("not ok ok");
            	</script>
            </c:if>

  2. #2
    Join Date
    Jan 2011
    Location
    Kirovohrad, Ukraine
    Posts
    59

    Default

    Change != to ne, that's the proper syntax for EL.

    Though I'd suggest you not to put any business logic (i.e. password matching) into the view layer, that smells as a design flaw. Instead I'd implement a validator comparing the values.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •