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!

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top