473,769 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can i get to the textarea in Gmail Draft.

I am trying to make a bookmarklet to enlarge textarea in Gmail. But I
can't get to the textarea.
When you are composing a message in Gmail, the page has two frames. the
first frame has name "main". That frame contains a textarea named
"msgbody" in which you compose messages.

I have tried with Firebug getElementsByTa gName and getElementsByNa me
but all fails.
self.main.docum ent.getElements ByTagName('text area') returns empty list.
self.main.docum ent.getElements ByName('msgbody ') also returns empty
list.
I suspect that it is because the textarea is buried deep in the DOM
tree.
The dom path from the main frame to the textarea is:
/html/body/table/tbody/tr[2]/td[2]/form/table/tbody/tr[5]/td/div[3]/table/tbody/tr[2]/td[2]/textarea

However the dom path from the main frame to the first div element is
/html/body/div
and self.main.docum ent.getElements ByTagName('div' ) returns a nonempty
list.

Jul 10 '06 #1
2 2063


HopfZ wrote:

I have tried with Firebug getElementsByTa gName and getElementsByNa me
but all fails.
self.main.docum ent.getElements ByTagName('text area') returns empty list.
Then what you think is a textarea is not one or that textarea is in a
different document.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 10 '06 #2
Martin Honnen wrote:
HopfZ wrote:

I have tried with Firebug getElementsByTa gName and getElementsByNa me
but all fails.
self.main.docum ent.getElements ByTagName('text area') returns empty list.

Then what you think is a textarea is not one or that textarea is in a
different document.

Thank you for your answer.
I found that there was an iframe between the main frame and the
textarea.
The name of the iframe is v1 or v2 depending on situations.

// get to the composing textarea in Gmail. (new message or a saved
draft)
var textArea1 = self.main.v1.do cument.getEleme ntById('ta_0');
var textArea2 = self.main.v2.do cument.getEleme ntById('ta_comp ose');
var theComposingTex tArea = textArea1 ? textArea1 : textArea2;

Jul 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
1557
by: Phil Powell | last post by:
The customer made a wild request: they want on their admin panel a textarea that will display an existing resume. This textarea, however, must have a dynamic width, one that "fills the screen width of any sized screen". Sorry but I cannot fathom how to do this! <textarea name="resume" cols="108" rows="29" wrap="physical><?= $resume ?></textarea>
5
12155
by: Jesper Rønn-Jensen | last post by:
I have a textarea that must be limited to 70 characters. No big deal -- at least so I thought. * Textarea must not exceed 70 characters * Exceeding content must be cut off * Must work on input by keyboard (keypress, keyup events) * Must work on pasted input from context menu * Must work on pasted input via CTRL+V and similar * Must work on pasted input via browsers menu>Edit>Paste * Must work in Mozilla + IE and coded via W3C standards
4
2293
by: delraydog | last post by:
If you've used the Google Gmail spell checker you know that it 'changes' the text area to another type of control that lets them show hyperlinks for the incorrect words. How does Google change the textarea? And what do they change it to? I know it should be pretty simple, I just have no clue because I'm fairly new to DHTML. Any examples would be greatly appreciated. Thanks! Cliff. delraydog@gmail.com
5
4583
by: bwucke | last post by:
Is there any way to scroll textarea (to the bottom row) from Javascript in Opera? The textarea.scrollTop=textarea.scrollHeight+textarea.scrollTop; approach doesn't work, and there's so many notices that it doesn't all over the net, that if there's any solution/workaround to this problem on the net, it's unfindable. Alternatively (my workaround) is there any way to reliably count lines
6
5991
by: wperry1 | last post by:
I am writing a small database utility to catalog all of my favorite ASM/JS/VBS... functions and scripts on an asp page. Everything is going smoothly except for one thing that I can't quite seem to think my way around. I am using a <textarea> to display the code but some of my scripts have <textarea> tags in them and when the </textarea> tag is entered, it closes my <textarea> and the rest of the code ends up outside of the textarea.
2
19286
by: mattrapoport | last post by:
Hello, I am have a div and inside of that div I have a textarea. There is nothing else in the div. The text in the textarea will come from a database so it needs to be able to wrap and grow as necessary. I've tried a whole bunch of permutations and I'm not having any luck. Any help would be greatly appreciated. Here's the code: HTML: <div class='desc'><textarea class='desc_text'>blah blah blah blah blah blah blah blah blah blah...
6
4643
by: Eric Layman | last post by:
Hi, I have fields from textareas. With a click of a button, php is able to grab these fields and by using header(), convert the output to Ms Word doc. But the outcome of the word doc doesn't wrap the text in textarea. the result is one very veyr long string of text which stretch MS word all
23
3831
by: Angus | last post by:
Hello I have a DIV with various elements eg: <div ARID="8" ARType="Char" ARDBN="Short Description"> <label class="label f9" for="arid8"Short Description</label> <textarea class="text sr " wrap="off" id="arid8" rows=1></textarea> </div> I have a variable, divs, which contains the DIV's and divs contains
4
2176
by: samslists | last post by:
Hi... I've seen code which changes a paragraph into a textarea (to allow it to be edited)...by creating a brand new text area, inserting that into the dom at the right place, and deleting the paragraph from the dom. I.e. http://www.quirksmode.org/dom/cms.html What I'm wondering is: is there some way to simplify this? Can I just tell the paragraph to become a textarea?
0
9422
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10038
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9857
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8867
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7404
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5294
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2812
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.