php - Hide Ajax Form After Submit -


i'm using simple ajax form , it's working well: http://blog.teamtreehouse.com/create-ajax-contact-form#comments

there 1 little change need do.

is there way, using form, hide after message sent?

until try using toggle jquery function in submit button, in way form desapear if mail wasn't sent.

i know need use listener in html, browser knows when hide form, i'm begginer in js, ajanx, json, etc...

thank in advance , i'm sorry english, i'm code , language self learner ;)

you should in done function of ajax call :

.done(function(response) {     // …     // clear form.     $('#name').val('');     $('#email').val('');     $('#message').val('');     // hide form     $('#ajax-contact').hide(); } 

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -