<SCRIPT LANGUAGE="JavaScript">
function MsgBox (textstring) {alert (textstring) }
</SCRIPT>
$currentanswer contains the string "Heart"...
I've echoed it out to the screen before and know that it contains it.
<input type=button value="Show Answer" name="btnShowAnswer" onClick="MsgBox(<?php echo $currentanswer; ?>)"></p>
I have tried adding the semicolon before.. that was just a typo..
It resulted in the same error as described above...
Thats all the code relating to this problem...
I am creating a webpage that asks study questions and i have a button that says show answer that I want to pop up the correct answer to the current question.
I just need the string that is in the php variable $currentanswer to be my message string in the MsgBox function and I cant quite figure out how to do that if its possible to do.