smileys & bold/italic/etc... buttons

More
18 years 4 months ago #114 by cyber1
Hello,

I have modified the add entry page by moving the smilieys down after the message box and have moved the bold/italics/etc... buttons just above the message box. Now none of these are working. If I choose bold and submit, I get the brackets and no bold letters. Same for the smileys.

Please Log in or Create an account to join the conversation.

More
18 years 4 months ago #115 by cyber1
Because the guestbook is running local on my pc while I talor it to my needs, here is a snip of that section I modified:
Code:
<form name="post" action="add.php" method="post"> <table border="0" cellpadding="0" cellspacing="2"> <tr> <td> <p><b><font size="2"><?php echo $yournametxt; ?></font></b></p> </td> <td><input type="text" name="yourname" size="20"></td> </tr> <tr> <td> <p><b><font size="2"><?php echo $youremailtxt; ?></font></b></p> </td> <td><input type="text" name="youremail" size="20" value=""></td> </tr> <tr> <td> <p><b><font size="2"><?php echo $yourphonetxt; ?></font></b></p> </td> <td><input type="text" name="yourphone" size="20"></td> </tr> <tr> <td> <p><b><font size="2"><?php echo $yourprovidertxt; ?></font></b></p> </td> <td><input type="text" name="yourprovider" size="20"></td> </tr> <tr> <td> <p><b><font size="2"><?php echo $yourcountrytxt; ?></font></b></p> </td> <td><input type="text" name="yourcountry" size="20"></td> </tr> <?php if($image_verify == 1) { echo '<tr><td valign=bottom><p><b><font size="2">Verify:</font></b></p></td><td valign=bottom><input type="text" name="txtNumber" size="8" value="">&nbsp;&nbsp;&nbsp;<img src="random.php"></td></tr>'; } ?> <tr> <td> <p><b><font size="2">&nbsp;</font></b></p> </td> <td align=center><BR><BR><input type="button" class="button" value=" Bold " style="font-weight:bold; width: 50px" onClick="javascript:bbcode('[b] [/b]')"> <input type="button" class="button" value=" Underline " style="font-weight:bold; width: 80px" onClick="javascript:bbcode('[u] [/u]')"> <input type="button" class="button" value=" Italic " style="font-weight:bold; width: 50px" onClick="javascript:bbcode('[i] [/i]')"> <input type="button" class="button" value=" Center " style="font-weight:bold; width: 70px" onClick="javascript:bbcode('[center] [/center]')"></td> </tr> <tr> <td> <p><b><font size="2"><?php echo $yourMessagetxt; ?></font></b></p> </td> <td> <div align="right"> <textarea name="yourmessage" cols="45" rows="10"></textarea></div> </td> </tr> <!-- Smiley List Starts Here --> <tr> <td> <p><b><font size="2">&nbsp;</font></b></p> </td> <td> <p><b><font size="2">&nbsp;</font></b></p> </td> <tr> <td> <p><b><font size="2">&nbsp;</font></b></p> </td> <td align=center><font size="2"><u>Clickable Smilies</u></font><BR><BR> [url=javascript:emoticon(':D')]<img src="images/icon_biggrin.gif" border="0" alt="Very Happy" title="Very Happy">[/url] [url=javascript:emoticon(':)')]<img src="images/icon_smile.gif" border="0" alt="Smile" title="Smile">[/url] [url=javascript:emoticon(':(')]<img src="images/icon_sad.gif" border="0" alt="Sad" title="Sad">[/url] [url=javascript:emoticon(':o')]<img src="images/icon_surprised.gif" border="0" alt="Surprised" title="Surprised">[/url] [url=javascript:emoticon(':shock:')]<img src="images/icon_eek.gif" border="0" alt="Shocked" title="Shocked">[/url] [url=javascript:emoticon(':?')]<img src="images/icon_confused.gif" border="0" alt="Confused" title="Confused">[/url] [url=javascript:emoticon(':cool:')]<img src="images/icon_cool.gif" border="0" alt="Cool" title="Cool">[/url] [url=javascript:emoticon(':lol:')]<img src="images/icon_lol.gif" border="0" alt="Laughing" title="Laughing">[/url] [url=javascript:emoticon(':x')]<img src="images/icon_mad.gif" border="0" alt="Mad" title="Mad">[/url] [url=javascript:emoticon(':P')]<img src="images/icon_razz.gif" border="0" alt="Razz" title="Razz">[/url]</td></tr> <tr><td> <p><b><font size="2">&nbsp;</font></b></p></td> <td align=center> [url=javascript:emoticon(':oops:')]<img src="images/icon_redface.gif" border="0" alt="Embarassed" title="Embarassed">[/url] [url=javascript:emoticon(':cry:')]<img src="images/icon_cry.gif" border="0" alt="Crying" title="Crying">[/url] [url=javascript:emoticon(':evil:')]<img src="images/icon_evil.gif" border="0" alt="Evil or Very Mad" title="Evil or Very Mad">[/url] [url=javascript:emoticon(':twisted:')]<img src="images/icon_twisted.gif" border="0" alt="Twisted Evil" title="Twisted Evil">[/url] [url=javascript:emoticon(':roll:')]<img src="images/icon_rolleyes.gif" border="0" alt="Rolling Eyes" title="Rolling Eyes">[/url] [url=javascript:emoticon(':wink:')]<img src="images/icon_wink.gif" border="0" alt="Wink" title="Wink">[/url] [url=javascript:emoticon(':!:')]<img src="images/icon_exclaim.gif" border="0" alt="Exclamation" title="Exclamation">[/url] [url=javascript:emoticon(':?:')]<img src="images/icon_question.gif" border="0" alt="Question" title="Question">[/url] [url=javascript:emoticon(':idea:')]<img src="images/icon_idea.gif" border="0" alt="Idea" title="Idea">[/url] [url=javascript:emoticon(':arrow:')]<img src="images/icon_arrow.gif" border="0" alt="Arrow" title="Arrow">[/url]</td> </tr> <!-- Smiley List Stops Here --> <tr> <td></td> <td> <BR><div align="center"> <input type="submit" name="ok" value="<?php echo $submitbutton; ?>"> </td> </tr> </table> </form>

Please Log in or Create an account to join the conversation.

More
18 years 4 months ago #117 by Pete
There is a javascript function called "emoticon()" on the original page that inserts smiley into the textarea. I don't see it in your version. Did you forget to put it on your re-designed page?

DigiOz Webmaster
www.digioz.com

Please Log in or Create an account to join the conversation.

More
18 years 4 months ago #118 by cyber1
Are you refering to this? If so, this is in the same location as the original and was not moved or removed.
Code:
<script language="JavaScript" type="text/javascript"> function emoticon(text) { var txtarea = document.post.yourmessage; text = ' ' + text + ' '; if (txtarea.createTextRange && txtarea.caretPos) { var caretPos = txtarea.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text; txtarea.focus(); } else { txtarea.value += text; txtarea.focus(); } } function bbcode(text) { var txtarea = document.post.yourmessage; text = ' ' + text + ' '; if (txtarea.createTextRange && txtarea.caretPos) { var caretPos = txtarea.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text; txtarea.focus(); } else { txtarea.value += text; txtarea.focus(); } } </script>

Please Log in or Create an account to join the conversation.

More
18 years 4 months ago #119 by Pete

cyber1 wrote: Hello,

I have modified the add entry page by moving the smilieys down after the message box and have moved the bold/italics/etc... buttons just above the message box. Now none of these are working. If I choose bold and submit, I get the brackets and no bold letters. Same for the smileys.


Rather then trying to see what you did wrong in your version, here is a modified version of the add form that meets your description that actually does work (has been tested):
Code:
<?php include("header.php"); //include("language/language.php"); ?> <script language="JavaScript" type="text/javascript"> function emoticon(text) { var txtarea = document.post.yourmessage; text = ' ' + text + ' '; if (txtarea.createTextRange && txtarea.caretPos) { var caretPos = txtarea.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text; txtarea.focus(); } else { txtarea.value += text; txtarea.focus(); } } function bbcode(text) { var txtarea = document.post.yourmessage; text = ' ' + text + ' '; if (txtarea.createTextRange && txtarea.caretPos) { var caretPos = txtarea.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text; txtarea.focus(); } else { txtarea.value += text; txtarea.focus(); } } </script> <table bgcolor=#EFEFEF bordercolor=#C0C0C0 border=1 width=500 cellspacing=0 cellpadding=10><tr><td background="images/toolbar.jpg" height="20"></td></tr><tr><td> <br> <form name="post" action="add.php" method="post"> <table border="0" cellpadding="0" cellspacing="2"> <tr> <td colspan=2> <!-- Styling Button Start --> <center> <table width="100" border="0" cellspacing="0" cellpadding="5"> <tr align="center" valign="middle"> <td><input type="button" class="button" value=" Bold " style="font-weight:bold; width: 50px" onClick="javascript:bbcode('[b] [/b]')"></td> <td><input type="button" class="button" value=" Underline " style="font-weight:bold; width: 80px" onClick="javascript:bbcode('[u] [/u]')"></td> <td><input type="button" class="button" value=" Italic " style="font-weight:bold; width: 50px" onClick="javascript:bbcode('[i] [/i]')"></td> <td><input type="button" class="button" value=" Center " style="font-weight:bold; width: 70px" onClick="javascript:bbcode('[center] [/center]')"></td> </tr> </table> </center> <!-- Styling Button End --> </td> </tr> <tr> <td> <p><b><font size="2"><?php echo $yournametxt; ?></font></b></p> </td> <td><input type="text" name="yourname" size="20"></td> </tr> <tr> <td> <p><b><font size="2"><?php echo $youremailtxt; ?></font></b></p> </td> <td><input type="text" name="youremail" size="20" value=""></td> </tr> <?php if($image_verify == 1) { echo '<tr><td><p><b><font size="2">Verify:</font></b></p></td><td><input type="text" name="txtNumber" size="20" value=""><img src="random.php"></td></tr>'; } ?> <tr> <td> <p><b><font size="2"><?php echo $yourMessagetxt; ?></font></b></p> </td> <td> <div align="right"> <textarea name="yourmessage" cols="45" rows="10"></textarea></div> </td> </tr> <tr> <td></td> <td> <div align="right"> <input type="submit" name="ok" value="<?php echo $submitbutton; ?>"> </td> </tr> <tr> <td colspan=2> <!-- Smiley List Starts Here --> <center> <table width="100" border="0" cellspacing="0" cellpadding="5"> <tr align="center" valign="middle"> <td>[url=javascript:emoticon(':D')]<img src="images/icon_biggrin.gif" border="0" alt="Very Happy" title="Very Happy">[/url]</td> <td>[url=javascript:emoticon(':)')]<img src="images/icon_smile.gif" border="0" alt="Smile" title="Smile">[/url]</td> <td>[url=javascript:emoticon(':(')]<img src="images/icon_sad.gif" border="0" alt="Sad" title="Sad">[/url]</td> <td>[url=javascript:emoticon(':o')]<img src="images/icon_surprised.gif" border="0" alt="Surprised" title="Surprised">[/url]</td> <td>[url=javascript:emoticon(':shock:')]<img src="images/icon_eek.gif" border="0" alt="Shocked" title="Shocked">[/url]</td> <td>[url=javascript:emoticon(':?')]<img src="images/icon_confused.gif" border="0" alt="Confused" title="Confused">[/url]</td> <td>[url=javascript:emoticon(':cool:')]<img src="images/icon_cool.gif" border="0" alt="Cool" title="Cool">[/url]</td> <td>[url=javascript:emoticon(':lol:')]<img src="images/icon_lol.gif" border="0" alt="Laughing" title="Laughing">[/url]</td> <td>[url=javascript:emoticon(':x')]<img src="images/icon_mad.gif" border="0" alt="Mad" title="Mad">[/url]</td> <td>[url=javascript:emoticon(':P')]<img src="images/icon_razz.gif" border="0" alt="Razz" title="Razz">[/url]</td> </tr> <tr align="center" valign="middle"> <td>[url=javascript:emoticon(':oops:')]<img src="images/icon_redface.gif" border="0" alt="Embarassed" title="Embarassed">[/url]</td> <td>[url=javascript:emoticon(':cry:')]<img src="images/icon_cry.gif" border="0" alt="Crying" title="Crying">[/url]</td> <td>[url=javascript:emoticon(':evil:')]<img src="images/icon_evil.gif" border="0" alt="Evil or Very Mad" title="Evil or Very Mad">[/url]</td> <td>[url=javascript:emoticon(':twisted:')]<img src="images/icon_twisted.gif" border="0" alt="Twisted Evil" title="Twisted Evil">[/url]</td> <td>[url=javascript:emoticon(':roll:')]<img src="images/icon_rolleyes.gif" border="0" alt="Rolling Eyes" title="Rolling Eyes">[/url]</td> <td>[url=javascript:emoticon(':wink:')]<img src="images/icon_wink.gif" border="0" alt="Wink" title="Wink">[/url]</td> <td>[url=javascript:emoticon(':!:')]<img src="images/icon_exclaim.gif" border="0" alt="Exclamation" title="Exclamation">[/url]</td> <td>[url=javascript:emoticon(':?:')]<img src="images/icon_question.gif" border="0" alt="Question" title="Question">[/url]</td> <td>[url=javascript:emoticon(':idea:')]<img src="images/icon_idea.gif" border="0" alt="Idea" title="Idea">[/url]</td> <td>[url=javascript:emoticon(':arrow:')]<img src="images/icon_arrow.gif" border="0" alt="Arrow" title="Arrow">[/url]</td> </tr> </table> </center> <!-- Smiley List Stops Here --> </td> </tr> </table> </form> </td></tr></table><!-- End of toolbar table --> <?php include("footer.php"); ?>

And here is a snapshot of it:


DigiOz Webmaster
www.digioz.com

Please Log in or Create an account to join the conversation.

More
18 years 3 months ago #124 by cyber1
Hello,

I finally got the guestbook added to the site. What do you think?

pcs.cruz-network.net/gbook/

Please Log in or Create an account to join the conversation.

Time to create page: 0.127 seconds
Powered by Kunena Forum