I am using the mootools framework to add text inputs to a form. Here is my code:
http://jsfiddle.net/dazaweb/wjMJt/2/
As you can see, the input field appears for a sec, then disappears. Any ideas on why this is happening?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You are clicking on a submit button which will POST the form. Change the input type to
buttonand it will work. Or you can prevent the default behaivor if you still want to use a submit button.Here is a working link with a button insteed of submit:
http://jsfiddle.net/wjMJt/3/
You can also prevent the default behavoir by cancel the bubbling.
Just add
e.stop();inside your function, and pass the event argument as a variable named e like this:Example:
http://jsfiddle.net/wjMJt/6/