Announcement Announcement Module
Collapse
No announcement yet.
password and confirm password Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment

    Working...
    X