Gubbins Posted October 29, 2008 Share Posted October 29, 2008 Ok the code below adds bold tags into a message box:- <input class="submit" value="bold" name="bold" onFocus="display(thisForm.msg, '', '');" style="font-weight: bold;" type="button" /> I want to add a smilies into the same message box but i cant seem to get the code right, i have tried this:- <img src="images/Emoticons/cool.gif" value="[cool]" type="button" '[cool]');"> But it only displays the image and its not clickable, does anyone know where i am going wrong please? Quote Link to comment https://forums.phpfreaks.com/topic/130576-buttons/ Share on other sites More sharing options...
KevinM1 Posted October 29, 2008 Share Posted October 29, 2008 1. This is a JavaScript problem, not a PHP problem. 2. You need to show more than two lines of code. Quote Link to comment https://forums.phpfreaks.com/topic/130576-buttons/#findComment-677461 Share on other sites More sharing options...
Gubbins Posted October 29, 2008 Author Share Posted October 29, 2008 ok this works:- <body onLoad="thisForm=document.formsend;"> <form action="" method="post" name="formsend"> <table width="50%" align="center" class="tbl"> <tr><td align="center"> <input class="submit" value="bold" name="bold" onFocus="display(thisForm.msg, '', '');" style="font-weight: bold;" type="button" /> </tr></tr> <tr><td align="center"> </tr></tr> </table> but i want to make another table and have smilies in it like what you see when you reply to this message, I have tried this but it does not work:- <img src="images/Emoticons/cool.gif" value="[cool]" type="button" '[cool]');"> Quote Link to comment https://forums.phpfreaks.com/topic/130576-buttons/#findComment-677478 Share on other sites More sharing options...
revraz Posted October 29, 2008 Share Posted October 29, 2008 Again, this is not PHP related. Quote Link to comment https://forums.phpfreaks.com/topic/130576-buttons/#findComment-677482 Share on other sites More sharing options...
kenrbnsn Posted October 29, 2008 Share Posted October 29, 2008 Moving this to the Javascript help area... Ken Quote Link to comment https://forums.phpfreaks.com/topic/130576-buttons/#findComment-677497 Share on other sites More sharing options...
Gubbins Posted October 29, 2008 Author Share Posted October 29, 2008 ok i have got a little further this:- <input onFocus="display(thisForm.msg, '[cool]');" style="images/Emoticons/cool.gif;" type="button" /> That now puts the [cool] into the message box but the button doesn't display anything and i guess i should have the image entered into the message box! Please help i am struggling Quote Link to comment https://forums.phpfreaks.com/topic/130576-buttons/#findComment-677620 Share on other sites More sharing options...
Gubbins Posted October 30, 2008 Author Share Posted October 30, 2008 This now enters "[cool]undefined" into the message box, i am unsure why i get "undefind" next to "[cool]" and it disapears as soon as it appears. <input type="image" src="images/Emoticons/cool.gif" onFocus="display(thisForm.msg, '[cool]');" title="Cool" type="button"> I think i am almost there, can anyone help please? Quote Link to comment https://forums.phpfreaks.com/topic/130576-buttons/#findComment-678357 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.