When the user clicks the submit button, a confirmation dialog box appears asking them if they want to continue. i am trying to pass a php variable to the
js method, but it doesn't seem to like it. here is my code:
js:
Code:
<script type="text/JavaScript">
<!--
function show_confirm(str)
{
var r=confirm("Are you sure you would like to change your username to " + str + "?");
}
// -->
</script>
html:
Code:
<?php $uname = "username"; ?>
<input type="submit" name="submit" id="submit" value="Submit" class="button" onclick="show_confirm($uname)" />