[thelist] [JS] trying to do a bookmarklet and failing
Tom Dell'Aringa
pixelmech at yahoo.com
Fri May 28 08:14:15 CDT 2004
Hi folks,
I've been trying to build this little bookmarklet that resizes a
textarea on a page. I've read some tutorials online but I can't get
mine to work. Here's the deal. I have a textarea on the page:
<textarea name="message" rows="10" cols="20"></textarea>
I want to click the bookmarklet and make the rows/cols like 40/100,
so I tried:
<a href="javascript:document.formName.message.rows=40;
document.formName.message.cols=100;">Adjust Box</a>
What happens there is I get a new page with the text '100' - so I
figured I needed a 'return false;' at the end. Trying that gives me
an 'invalid return' error.
<a href="javascript:document.formName.message.rows=40;
document.formName.message.cols=100;return false;">Adjust Box</a>
So lastly, I tried using the old void method:
<a href="javascript: void(document.formName.message.rows=40;
document.formName.message.cols=100)">Adjust Box</a>
Yet I get
Error: missing ) in parenthetical
Source File: javascript: void(document.formName.message.rows=40;
document.formName.message.cols=100)
Line: 1, Column: 37
Source Code:
void(document.formName.message.rows=40;
document.vbform.message.cols=100)
I don't see where a parenthetical is missing at all. Any help is
appreciated - this should be simple but nothing works.
Tom
=====
http://www.Pixelmech.com/ - read my latest blog posting!
http://www.crossandthrone.com/ - Eternal Life
John 3:16
More information about the thelist
mailing list