0

I wrote following javascript code:

 $("#email").change(function () {
        email = $("#email").val()
        if (validateEmail(email)) {
            $('#button').enable();
        } else {
            $('#button').disable();
        }
    })

Also I have following form:

<form name='register_form' action="<c:url value='/register_new_user' />" method='POST'
            onsubmit="return validateRegisterForm(this);">

            <div class="input-line">
            <input type="text" class="text" name='email' id='email' />


            <div class="input-line bottom">
                <input type="submit" class="button" value="зарегистрироваться" id='button' />
            </div>

</form>

function passed to change method doesn't execute when I change value of input.

Why? how to achieve it?

0

2 Answers 2

0

Does the event fire on "blur" of the input field? I don't think it naturally fires on keypress.

If you wanted it on keypress, you could just use .bind('input', function(){...

Sign up to request clarification or add additional context in comments.

Comments

0

The browser is showing any error for you? Like missing components or not finding elements? It can gives a clue about what is happening

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.