Jump to content

Recommended Posts

i have this form

$HTMLOUT .= "<h1>{$lang['comment_add']}\"" . htmlspecialchars($arr["name"]) . "\"</h1>
      <p><form method='post' action='comment.php?action=add'>
      <input type='hidden' name='tid' value='{$torrentid}'/>
      <textarea name='text' rows='10' cols='60'></textarea></p>
      <p><input type='submit' class='btn' value='{$lang['comment_doit']}' /></p></form>";

 

 

this javascript code

<a href=\"javascript:SmileIT(':-)','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/smile1.gif' alt='Smile' title='Smile' /></a> 
<a href=\"javascript:SmileIT(':smile:','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/smile2.gif' alt='Smiling' title='Smiling' /></a> 
<a href=\"javascript:SmileIT(':-D','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/grin.gif' alt='Grin' title='Grin' /></a> 
<a href=\"javascript:SmileIT('','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/laugh.gif' alt='Laughing' title='Laughing' /></a> 
<a href=\"javascript:SmileIT(':w00t:','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/w00t.gif' alt='W00t' title='W00t' /></a> 
<a href=\"javascript:SmileIT(';-)','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/wink.gif' alt='Wink' title='Wink' /></a> 
<a href=\"javascript:SmileIT(':devil:','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/devil.gif' alt='Devil' title='Devil' /></a> 
<a href=\"javascript:SmileIT(':yawn:','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/yawn.gif' alt='Yawn' title='Yawn' /></a> 
<a href=\"javascript:SmileIT(':-/','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/confused.gif' alt='Confused' title='Confused' /></a> 
<a href=\"javascript:SmileIT(')','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/clown.gif' alt='Clown' title='Clown' /></a> 
<a href=\"javascript:SmileIT(':innocent:','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/innocent.gif' alt='Innocent' title='innocent' /></a> 
<a href=\"javascript:SmileIT(':whistle:','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/whistle.gif' alt='Whistle' title='Whistle' /></a> 
<a href=\"javascript:SmileIT('','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/unsure.gif' alt='Unsure' title='Unsure' /></a> 
<a href=\"javascript:SmileIT(':blush:','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/blush.gif' alt='Blush' title='Blush' /></a> 
<a href=\"javascript:SmileIT(':hmm:','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/hmm.gif' alt='Hmm' title='Hmm' /></a> 
<a href=\"javascript:SmileIT(':hmmm:','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/hmmm.gif' alt='Hmmm' title='Hmmm' /></a> 
<a href=\"javascript:SmileIT('','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/huh.gif' alt='Huh' title='Huh' /></a> 
<a href=\"javascript:SmileIT(':look:','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/look.gif' alt='Look' title='Look' /></a> 
<a href=\"javascript:SmileIT('','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/rolleyes.gif' alt='Roll Eyes' title='Roll Eyes' /></a> 
<a href=\"javascript:SmileIT(':kiss:','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/kiss.gif' alt='Kiss' title='Kiss' /></a> 
<a href=\"javascript:SmileIT('','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/blink.gif' alt='Blink' title='Blink' /></a> 
<a href=\"javascript:SmileIT(':baby:','shbox','shbox_text')\"><img border='0' src='{$xLeech['x']}/pic/smilies/baby.gif' alt='Baby' title='Baby' /></a><br/>

 

and this .js file

function SmileIT(smile,form,text){
document.forms[form].elements[text].value = document.forms[form].elements[text].value+" "+smile+" ";
document.forms[form].elements[text].focus();
}
function PopMoreSmiles(form,name) {
link='moresmiles.php?form='+form+'&text='+name
newWin=window.open(link,'moresmile','height=500,width=450,resizable=no,scrollbars=yes');
if (window.focus) {newWin.focus()}
}
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=740,height=380,left = 340,top = 280');");
}
<!--
function mysubmit() {
setTimeout('document.shbox.reset()',100);
}
//-->
function confirm_delete()
{
   if(confirm('Are you sure you want to do this ?'))
   {
     if(confirm('Are you 100% sure ?'))
 {
	alert("Your are sure!");
	self.location.href='./shoutbox.php?delall';
 }
   }
}
function private_reply(to) { 
parent.document.forms[0].shbox_text.value='/private '+to+' ';
parent.document.forms[0].shbox_text.focus();
}

 

how can i insert a code into the form ?

i tried in every way posible ( i don't have any knowledge of javascript  :P )

 

 

Link to comment
https://forums.phpfreaks.com/topic/215859-simple-text-insert/
Share on other sites

i have this area

<textarea name='text' rows='10' cols='60'></textarea></p>

and when i click on javascript:SmileIT(':smile:','shbox','shbox_text')

 

i want to insert ":smile:"

> without "

 

it should't be doing that at all. There is nothing in a your javascript function that would make it do this.

Link to comment
https://forums.phpfreaks.com/topic/215859-simple-text-insert/#findComment-1123061
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.