The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Signature Bookmarklet
denmarks
post Aug 19 2009, 10:41 AM
Post #1


Advanced Member
****

Group: Members
Posts: 207
Joined: 17-January 08
Member No.: 4,734



I add a signature to many forums by using a bookmarklet. It just combines existing text with the signature. I must hard code each text box name to do it and it gets extremely complicated. Below is the bookmarklet. Is there a way to modify it so that it uses the text box with the cursor in it rather than a named one?
This one looks for "answer", "textarea2", "pmesg", and "answertext". I hate to keep adding more.

java script:try{document.getElementsByName('answer')[0].value+='\n\n%E2%82%AA%20%C9%A6%C9%99l%CA%9E%C9%B9%C9%90q%20%E2%82%AA'}catch(err){try{document.getElementsByName('textarea2')[0].value+='\n\n%E2%82%AA%20%C9%A6%C9%99l%CA%9E%C9%B9%C9%90q%20%E2%82%AA'}catch(err){try{document.getElementsByName('pmesg')[0].value+='\n\n%E2%82%AA%20%C9%A6%C9%99l%CA%9E%C9%B9%C9%90q%20%E2%82%AA'}catch(err){document.getElementsByName('answertext')[0].value+='\n\n%E2%82%AA%20%C9%A6%C9%99l%CA%9E%C9%B9%C9%90q%20%E2%82%AA'}}};void%200
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Aug 19 2009, 12:03 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(denmarks @ Aug 19 2009, 05:41 PM) *

I add a signature to many forums by using a bookmarklet. It just combines existing text with the signature.

Can't you enter the signature through your forum profile?

QUOTE
This one looks for "answer", "textarea2", "pmesg", and "answertext". I hate to keep adding more.

If there's just one TEXTAREA on the page you might look for

CODE
document.getElementsByTagName('textarea')[0]
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
denmarks
post Aug 19 2009, 02:38 PM
Post #3


Advanced Member
****

Group: Members
Posts: 207
Joined: 17-January 08
Member No.: 4,734



Thanks. That seems to work.

This post has been edited by denmarks: Aug 19 2009, 02:47 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th April 2024 - 01:45 PM