Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Newbie Needs Help Calling Color Picker

Posts: 1
Registered: 3/17/2011
Location: San Jose, CA
Member Is Offline
posted on 3/17/2011 at 04:07 PM Reply With Quote
Newbie Needs Help Calling Color Picker

I'm writing a context menu extension for Safari but I'm new to Javascript and so at this point I'm a little over me head.

You may be aware of this but an extension consists of a global HTML page and one or more Javascripts. The HTML dispatches messages to the Javascripts and the scripts listen for those dispatches via event listeners. I'd like to display and use the selection from Color Picker to color the user-selected text in the TEXTAREA of a web page.

What I've done so far is this:

In my HTML I have

<link rel=stylesheet href="color_select.css" type="text/css"/>
<script type="text/javascript" src="color_select.js"></script>
<form name='frmSelectColor' >
<!-- some inner HTML of the form -->
<!-- Add input box to the form -->
<input type="Text" name="theColor">
<!-- Color Picker initialization and anchor icon to call a picker -->
<a href="javascript:TCP.popup(document.forms['frmSelectColor'].elements['theColor'])">
<img width="15" height="13" border="0" alt="Click Here to Pick up the color" src="img/sel.gif"></a>

and in my Javascript I have

TCP.popup(document.forms['frmSelectColor'].userSelText, 0);

When the code executes I get a 'TypeError: Result of expression 'document.forms['frmSelectColor']' [undefined] is not an object' error and I don't know how to fix it.
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
 Product Demonstrations Live Demo
Free Download Free Download
Product Documentation Documentation
Support Forum Support Forum

Go To Top

Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004