Jump to content
MakeWebGames

Please Help.


MobTown

Recommended Posts

Ok...

I'll start with a couple of apologies, as I am not sure where this post is supposed to go, secondly this is probably the simplest thing in the world, yet it is still giving me trouble.

So basically I want to print some form elements but they have java script functions attached to them.

Now they only work if the quotations, (" and ') are kept in the same place, however by leaving them in this makes the

( print" code here "; ) mess up.

Does anyone know how to work around it. My code can be seen below.

 

print"
<button onclick="addPTag(document.getElementById('text'),'B')">[b]B[/b]</button>
<button onclick="addPTag(document.getElementById('text'),'I')">[i]I[/i]</button>
<button onclick="addPTag(document.getElementById('text'),'U')"><u>U</u></button>
";

 

Once again I apologise if this is simple, and or in the wrong place.

Link to comment
Share on other sites

Re: Please Help.

This should work for you

 

print <<<EOF
<button onclick="addPTag(document.getElementById('text'),'B')">[b]B[/b]</button>
<button onclick="addPTag(document.getElementById('text'),'I')">[i]I[/i]</button>
<button onclick="addPTag(document.getElementById('text'),'U')"><u>U</u></button>
EOF;
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...