Skip to main content
Participant
March 17, 2008
Question

Password Validation / Duplication

  • March 17, 2008
  • 4 replies
  • 464 views
I'm making a registration page and I was wondering, is there was a way to use ColdFusion (instead of Java) to validate a "Confirm Your Password" text input field? I'm sure there is but at the moment I cannot think of how to go about doing so. Any ideas?

Thanks!
    This topic has been closed for replies.

    4 replies

    Inspiring
    March 17, 2008
    V.K.R.'s solution is a lot simpler. However, if it were my app, I'd call the function when submitting the form, not on the onBlur event.
    Astonished_protector15C3
    Participating Frequently
    March 17, 2008
    Hi,

    You can use the onBlur events to achive this

    For Example

    <script>
    function fn_confirm()
    {
    var password=document.getElementById('password').value;
    var crm_password=document.getElementById('crm_password').value;
    if (password != crm_password)
    {
    alert("Password Missmatch");
    document.getElementById('crm_password').focus();
    }
    }
    </script>
    <form name="form1" method="post" action="">
    <input name="password" id="password" type="password">
    <input name="crm_password" type="password" id="crm_password" onBlur="fn_confirm();">
    </form>

    ReevespAuthor
    Participant
    March 17, 2008
    Thanks, but what about onBlur events? I want it to show immediately that the passwords do not match.
    Inspiring
    March 17, 2008
    quote:

    Originally posted by: Reevesp
    Thanks, but what about onBlur events? I want it to show immediately that the passwords do not match.

    Then you can't use cold fusion. You have to use something that runs on the client.
    Inspiring
    March 17, 2008
    You can use cold fusion after the form has been submitted.