Well my question is that I must add to the javascripr for when I click on the submit in this case I will clear the text box that in my case is one, that is the textarea. Thanks in advance this is my code
<textarea id="user_message_textarea"style="resize:none;height:100px;width:700px;" class="form-control" placeholder="Texto que voy a poner en el placeholder"></textarea>
<br>
<button id="user_message_button" type="button" class="button">Enviar</button>
</center>
</div>
</div>
</div>
</div>
<div id="snackbar_nuevo_servicio">Mensaje enviado. Gracias</div>
<script>
var showing_snackbar = false;
function user_message_success(){
var x = document.getElementById("snackbar_nuevo_servicio");
var b = document.getElementById("user_message_button");
x.className = "show_nuevo_servicio";
b.className = "btn btn-primary btn-md disabled";
showing_snackbar = true;
setTimeout(function(){ x.className = x.className.replace("show_nuevo_servicio", ""); showing_snackbar = false; b.className = "btn btn-primary btn-md";}, 3000);
}
$("#user_message_button").click(function(){
if(($("#user_message_textarea").val()).trim() !== ""){
if(showing_snackbar == false){
$.post("user_message.php",
{
user_message: $("#user_message_textarea").val()
},
function(data, status){
if(status == "success"){
user_message_success();
}
});
}
}
});
</script>