Shoutbox

Javascript Help - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Javascript Help (/showthread.php?tid=50831)

Javascript Help by wj on 09-23-2005 at 04:44 PM

Hey Guys! Need some JS help.

I need to add about 5 text links right above a text area to add quick texts to the text box. Now I've got about 30 text boxes on the page (all textareas) and I need one set for each.

The text area names are like: notes[3595]
The quick texts are going to be something like: "On hold for parts" or "Playing with my yonker to piss you off"

The text needs to be appended to the notes feild.

How do I accomplish this?


RE: Javascript Help by hmaster on 09-23-2005 at 05:21 PM

Im not sure I get what you mean ? Like when you click it it displays a message?


RE: Javascript Help by wj on 09-23-2005 at 05:24 PM

When I click a link, I want it to add a preset text to the associated text area. Similar to the quick quote function, but I need to do it with mulitple text areas.


document.input.notes[333].value += 'test';

Doing that gives me an error. How do I deal with the fact they all have the array style name. And no it cant be changed.


RE: Javascript Help by Eljay on 09-23-2005 at 05:49 PM

code:
<script language="javascript">
function quotethingforwj(quote,id){
blah = document.getElementsByName('notes[' + id + ']');
old = blah[0].value;
blah[0].value = old + quote;
}
</script>

e.g

<a href="javascript:quotethingforwj('if omar would pay, i would come', 1)">add quote</a>
<textarea name="notes[1]" value=""></textarea>
RE: Javascript Help by wj on 09-23-2005 at 07:10 PM

THANK YOU LEE JEFFERY!!!!!

THANK YOU THANK YOU THANK YOU THANK YOU./