Wutup
Im trying to write a php script that has a link. When the user clicks the link the link turns into a text field which the user can modify. When the user clicks elsewhere the text that the user typed is turned back into a link. Ive got the php script which Im supposed to change and I got a piece of javascript code that does the whole link changing of link to textfield and back again thing.
Problem Im having is I dont understand how to combine the two together. I tried to echo the javascript tags similar to how html tags can be echoed but that didnt work. I googled and found examples similar to this:
Is there any way I can put the javascript within the php part of the code?
Thanks
Im trying to write a php script that has a link. When the user clicks the link the link turns into a text field which the user can modify. When the user clicks elsewhere the text that the user typed is turned back into a link. Ive got the php script which Im supposed to change and I got a piece of javascript code that does the whole link changing of link to textfield and back again thing.
Problem Im having is I dont understand how to combine the two together. I tried to echo the javascript tags similar to how html tags can be echoed but that didnt work. I googled and found examples similar to this:
Code:
<?php
echo("This is php");
?>
<script....
//javascript stuff goes here
</script>
Is there any way I can put the javascript within the php part of the code?
Thanks
Comment