I want to make the output of a <form>
in the same page of submit, I did it with html <iframe>
, is there any alternative besides jQuery and Ajax?
Thanks in advance.
I want to make the output of a <form>
in the same page of submit, I did it with html <iframe>
, is there any alternative besides jQuery and Ajax?
Thanks in advance.
If you leave the "action" attribute of the form
tag empty it will be submitted to the same page. You can then check to see if the form has been submitted and process the page accordingly.
Maybe something like:
<?php
if($_POST['submitted']){
echo "I have been submitted";
echo "<br/>";
echo $_POST['text_input'];
}
?>
<form method="post">
<input type="text" name="text_input">
<input type="submit" value="Submit" name="submitted">
</form>