Forum Moderators: coopster
<?php $test=" me ";?>
<script type="text/javascript">
function myTest(){
alert(" this is " + <?php $test;?>);
}
</script><input type="button" id="b3" name="b3" value="3" onClick="myTest()" />
[edited by: eelixduppy at 5:04 pm (utc) on Sep. 27, 2007]
[edit reason] disabled smileys [/edit]
<script type="text/javascript">
function myTest(){
alert(" this is " + <?php echo "\"$test\"";?>);
}
</script>
<input type="button" id="b3" name="b3" value="3" onClick="myTest()" />
the above code works... you can test it ...
in your code you have just specified the variable name...
you have to substitute the value of text in that place...
and also you can use the simple following code...
<?php
$test="me";
?>
<script type="text/javascript">
function myTest(){
alert(" this is <?php echo $test;?> ");
}
</script>
<input type="button" id="b3" name="b3" value="3" onClick="myTest()" />
[edited by: eelixduppy at 5:05 pm (utc) on Sep. 27, 2007]
[edit reason] disabled smileys [/edit]