Question

I'm figuring out how to add submit button when e-mail is valid from field, there a jsfiddle you can understand it:

http://jsfiddle.net/5bQQW/

It didn't work because it doesn't appear a submit button after of valid e-mail

Can anyone help me it?

thx!

Was it helpful?

Solution

Your if and else conditions are the same, therefore the else won't get executed until you remove the not (!). But then there's the problem if the address matches your pattern but the user continues to type a valid email. Then multiple submit buttons are appended. You'd be best off just showing and hiding the button rather than constantly appending an element.

Try working off of a revision of your jsFiddle.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top