Text in input tag onclick
Posted January 14th 2012, 3:53pm
Am trying to insert text so when a smiley is clicked it inserts text (already defined) ina certain id textarea

http://jsfiddle.net/defencedog/P33FR/1/
φ
Posts: 163
Joined: August 5th 2011, 11:00pm
Location: Pakistan
Likes Given: 34
Likes Received: 3
Text in input tag onclick
Posted January 14th 2012, 4:15pm
In the sidebar, set the execution to no wrap (head)
φ
Posts: 64
Joined: June 17th 2011, 11:00pm
Location: 127.0.0.1/
Likes Given: 3
Likes Received: 2
Text in input tag onclick
Posted January 15th 2012, 9:50pm
can't understand
φ
Posts: 163
Joined: August 5th 2011, 11:00pm
Location: Pakistan
Likes Given: 34
Likes Received: 3
Text in input tag onclick
Posted January 16th 2012, 9:08am
In the sidebar, there's a drop down. Select "no wrap (head)" and your script will work.
φ
Posts: 64
Joined: June 17th 2011, 11:00pm
Location: 127.0.0.1/
Likes Given: 3
Likes Received: 2
Text in input tag onclick
Posted January 16th 2012, 9:39am
Image
φ
Posts: 237
Joined: October 29th 2011, 11:00pm
Location: england, united kingdom, stoke on trent
Likes Given: 20
Likes Received: 4
Re: Text in input tag onclick
Posted January 16th 2012, 11:37pm
plz explain 'no-head wrap'

now to the next step ( I want to introduce a smiley slider in a chatbox & I want to know are my following steps appropriate:

1) I changed the default onclick attribute of #divsmileys via:

    $(parent.chtifrm.document.body).find('#divsmilies').attr('onclick', '$(\'#smly\').toggle();');


my iframe id&name is chtifrm where chatbox is loaded

2) I introduced this html snippet in the loaded iframe:
<div id="smly" style="cursor:pointer;background:#f1f1f1;display:none;">

<img onclick="return addText(':)')" src="http://illiweb.com/fa/i/smiles/icon_razz.gif" />
<img onclick="return addText(':(')" src="http://illiweb.com/fa/i/smiles/icon_cry.gif" />
</div>

via using something like
  $(parent.chtifrm.document.body).find('#chatbox_footer').before('<div id=\"smly\" style=\"cursor:pointer;float:left;top:200px;display:none;position:absolute;\"><\/div>');


3) the final step requires your attention how do insert the required js snippet in the loaded iframe which happens to be

function addText(smiley) {
    document.getElementById('message').value += " " + smiley + " ";
    document.getElementById('message').focus();
    return false;
}



I have achieved slider of smileys but without js it is nothing; it willnt insert any smiley upon click in the textbox??
φ
Posts: 163
Joined: August 5th 2011, 11:00pm
Location: Pakistan
Likes Given: 34
Likes Received: 3
Re: Text in input tag onclick
Posted January 17th 2012, 8:29am
Try something like this:

parent.chtifrm.addText = function(smiley) {
  // codee
};
φ
Posts: 64
Joined: June 17th 2011, 11:00pm
Location: 127.0.0.1/
Likes Given: 3
Likes Received: 2
1
#8
Text in input tag onclick
Posted January 18th 2012, 5:24pm
ahh thnx ...though the like feature of this forum ain't working..but still thnx
φ
Posts: 163
Joined: August 5th 2011, 11:00pm
Location: Pakistan
Likes Given: 34
Likes Received: 3
Text in input tag onclick
Posted January 18th 2012, 5:50pm
Seems to be working for me. You should post in the bugs report thread.
φ
Posts: 509
Joined: July 9th 2011, 11:00pm
Location: England
Likes Given: 15
Likes Received: 26
Text in input tag onclick
Posted January 19th 2012, 8:09am
ioncube said:
ahh thnx ...though the like feature of this forum ain't working..but still thnx


I believe CORS is not supported in Opera.
φ
Posts: 64
Joined: June 17th 2011, 11:00pm
Location: 127.0.0.1/
Likes Given: 3
Likes Received: 2
Text in input tag onclick
Posted January 20th 2012, 1:50am
not in opera not in chrome ...thnx not working
φ
Posts: 163
Joined: August 5th 2011, 11:00pm
Location: Pakistan
Likes Given: 34
Likes Received: 3
Topic locked
11 posts

Who is online

Users browsing this forum: No registered users and 0 guests