I have a Ask Question
form by which client can ask any question to us. While client submit the form we will give him a thanks message for 5 seconds then hide the message and show again the Ask Question
form in that div.
But while the from comes after successful message, form input values is still there. I want a fresh from without any input value like the form before submitting.
Here is my ajax
code
$.ajax({
url:"{{ url('/ask_question_form') }}",
type: 'GET',
data: {_token :token, name : name, email : email, contact : contact, question : question},
success:function(msg){
// console.log(msg);
$('.question-modal .textwidget').hide();
trHTML = "";
trHTML += "<div id='user-question' style='margin-top:50%; color:#0071BC'>";
trHTML += "Thanks for your question. We will save your question for further query and give a feedback as soon as possible.";
trHTML += "</div>";
$('.question-modal').append(trHTML);
setTimeout(function() {
$('.question-modal #user-question').remove();
$('.question-modal .textwidget').show();
}, 5000);
}
});
Where textwidget
is the class name of that form