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