samedi 28 février 2015

I want to know how to only activate the form submit, not getting value to ajax url in jquery?

I want to submit a form without refresh page. My case is different than most people, I only need to initial the form submit, and then in the php, if $_POST, then gather the value. It is not duplicate question, because most answers are sending the form value to .ajax url and send the value back to html. I just want to initialize the submit.





$.ajax({
url:'member_search.php',
type:'POST',
data:{
search_text: $(".result_tag").text()
}

});



<form action="" method="post" name="form">
<input type="hidden" id="word" value="hello" name="input" >
</form>

<?php
if ($_POST){
$value=$_POST['input'];
echo $value;



?>



Aucun commentaire:

Enregistrer un commentaire