The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Bookmarklet problem
denmarks
post Nov 24 2008, 01:28 PM
Post #1


Advanced Member
****

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



NOTE: Ignore the space between java and script. The forum editor inserts it.

java script:document.getElementsByName('textarea1')[0].value+='aaaa';void 0

java script:document.getElementsByName('textarea2')[0].value+='bbbb';void 0

I have these two bookmarklets. They add text to the end of existing text in a field. Sometimes the field textarea1 exists and I use the first one. At other times only the second field exists and I use the second bookmarklet. I would like to combine them. I have tried

java script:document.getElementsByName('textarea1')[0].value+='aaaa';document.getElementsByName('textarea2')[0].value+='bbbb';void 0

but if there is no textarea1 it just ends and does not try textarea2. I there a way to have both parts and have it ignore any errors?

This post has been edited by denmarks: Nov 24 2008, 01:29 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic
denmarks   Bookmarklet problem   Nov 24 2008, 01:28 PM
denmarks   I found the solution. I use the TRY command around...   Nov 24 2008, 04:14 PM


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

 



- Lo-Fi Version Time is now: 25th April 2024 - 11:52 AM