2
I have the following form
<form method="POST">
<input id="comentario" type="text" name="comentario" id="comentario">
<input type="submit" name="Comentar" value="Comentar" id="Comentar">
</form>
And I need to display on the screen what’s typed in the input text. I also have this section that checks if the button was clicked (I intend to do my logic here)
<?php
if(isset($_POST['Comentar'])){
echo "botão foi clicado";
}
?>
you want to know if Submit was made by the boot? will there be more buttons? or See just want the Submit to be made by the boot?
– Michel Simões
What was written in
<input>
of the kindtext
(the first of the html displayed) is accessible with$_POST["comentario"]
. What is the specific issue?– Isac
@Isac she wants to recover button value, not input... Is there a need for Submit? could do with jquery and send via $.post? could better formulate your need, your resources pq suddenly your way is not the best way...
– Michel Simões
Catch the
value
of asubmit
? For what purpose ? Never changes is always the same. It seems to me an XY problem– Isac
I think the question title is wrong. What he wants is to recover the value of what was typed in
type="text
because no one I know can type anything into a Ubmit input– user60252
Oops, I really messed up, it’s input text. You can edit?
– Deyci
Just below the line
echo "botão foi clicado";
placeecho $_POST['comentario'];
– user60252
edited for you
– user60252
@Deyci you want to send via Ajax ? 'Cause if you’re just gonna send via POST not the need for the Javascript.
– NoobSaibot