jquery - Process Form with php Without refreshing -
i have form ( web poll) , radio answers , need when submitted information action file (voting.php) printed on same page without refreshing! please me i've been trying hard few hours, because i'm new ajax jquery , java , tricky dynamic stuff.
<form name="myform" id="myform" action="voting.php" method="post"> <input id="radio1" type="radio" name="answer" value="answer1"><?php echo $answer1?><br> <input id="radio2" type="radio" name="answer" value="answer2"><?php echo $answer2?><br> <input id="radio3" type="radio" name="answer" value="answer3"><?php echo $answer3?><br> <input id="radio4" type="radio" name="answer" value="answer4"><?php echo $answer4?><br> <input id="radio5" type="radio" name="answer" value="answer5"><?php echo $answer5?><br> <input id="questionid" type="hidden" name="questionid" value="<?php echo $questionid?>"> <center><input id="button" type="submit" value="vote"></center> </form>
if able use jquery, can like
$('#myform').submit(function(e){ e.preventdefault(); $.post('voting.php', {$(this).serialize()}, function(data){ $('#form').html(data); }) });
Comments
Post a Comment