Change the text of a div
Dadane02
Posted messages
341
Status
Member
-
MrHip7 Posted messages 31 Registration date Status Member Last intervention -
MrHip7 Posted messages 31 Registration date Status Member Last intervention -
Hello,
I am looking to change the text of a div in PHP.
Indeed, depending on the response that will be validated, I display a message in the box (which is a div) on the right.
Thank you for your guidance.
Configuration: Windows / Chrome 42.0.2311.90
--
The daily grind will soon derail, who wants to stay inside....
Just hold on tight.
I am looking to change the text of a div in PHP.
Indeed, depending on the response that will be validated, I display a message in the box (which is a div) on the right.
Thank you for your guidance.
Configuration: Windows / Chrome 42.0.2311.90
--
The daily grind will soon derail, who wants to stay inside....
Just hold on tight.
2 answers
-
Marie is obviously the subject!!! :D
No seriously, you need to retrieve the data validated by your form when clicking the button using a $_POST method, then, in the right div, you put a condition if($_POST(machin)) displaying this or that thing. -
<body>
<div id="Question" align="center">
<p><h3>Find the correct function of the word in red in the sentence below.</h3></p>
<p><u>Sentence 15</u> : <span class="rouge">Marie</span>, do you want to come to the house?</p>
<form name="form1" method="post" action="#">
<p>
<div id="choixDreponses">
<p>Check the right answer:</p>
<input type="radio" name="reponse" value="sujett" id="sujet" /> <label for="SUJ">Subject</label><br />
<input type="radio" name="reponse" value="attr" id="attribut" /> <label for="ATT">Subject attribute</label><br />
<input type="radio" name="reponse" value="cood" id="cod" /> <label for="COD">C.O.D</label><br />
<input type="radio" name="reponse" value="apoo" id="apo" /> <label for="APO">Apostrophe</label><br />
<input type="radio" name="reponse" value="cddn" id="cdn" /> <label for="CDN">C.D.N</label><br />
<input type="radio" name="reponse" value="cooi" id="coi" /> <label for="COI">C.O.I</label><br/>
<input type="radio" name="reponse" value="ccc" id="cc" /> <label for="CC">C.C</label><br/>
<input type="button" onclick="kellereponse()" value="Validate" id="BtnValide">
</div>
</p>
<p>
</p>
</form>
</div>
</body>