htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0 - Add-Ons:
color select outside of HTMLarea


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


weedmansteve
Novice

Apr 8, 2004, 1:55 PM

Post #1 of 5 (3900 views)
Shortcut
color select outside of HTMLarea Can't Post

I would like to use the really cool "color select popup" for another form field on the same page that already has an HTMLarea on it. This form field is just a text input that handles the border color for an image that the user will upload, and it is independent from the HTMLarea .

I tried looking at the JS to figure out how to handle it, but it was too complex for me. Could someone show me how to do this? For I'm hoping there is an easy way to borrow the color selector to use outside of HTMLarea with very few modifications.


Luis
Veteran

Apr 9, 2004, 12:20 AM

Post #2 of 5 (3882 views)
Shortcut
Re: [weedmansteve] color select outside of HTMLarea [In reply to] Can't Post

Hi weedmansteve:

This is quite easy. Actually, you don't have to mess up with the "color select popup" code. Just put this script in the head section of your textarea's page. (Make sure the var newcolor is in a single line. no wrapping):

<script>
function BorderColor(){
var oldcolor;
var newcolor = showModalDialog(_editor_url + "popups/set_color.html", oldcolor, "resizable: no; help: no; status: no; scroll: no;");
if (newcolor != null) {document.all.mycolor.value="#"+newcolor;}
else{document.all.mycolor.value="";}
}
</script>


Then, put your text input wherever in the page you need it and a link or a button to call the popup:

<INPUT TYPE="text" NAME="mycolor" VALUE="">
<A HREF="javascript:BorderColor();">Set Border Color</A>

I'm attaching set_color.html, in case you need it.

Greetings


Don't give up!!
http://webstationone.com/test/htmlarea
Attachments: set_color.html (3.65 KB)


weedmansteve
Novice

Apr 10, 2004, 9:43 PM

Post #3 of 5 (3853 views)
Shortcut
Re: [Luis] color select outside of HTMLarea [In reply to] Can't Post

Thanks a lot Luis, that works great! However, one more question, what is the purpose of the following inside set_color.html:


Code
<img border="0" src="../images/ed_transparentcolor.gif" onMouseOver=View(''); onClick=Set(''); >


Maybe I just don't understand because I don't have a copy of 'ed_transparentcolor.gif'


Luis
Veteran

Apr 11, 2004, 11:20 AM

Post #4 of 5 (3841 views)
Shortcut
Re: [weedmansteve] color select outside of HTMLarea [In reply to] Can't Post

Hi weedmansteve:

The purpose is to clear (remove) the previously selected color and set it to none. I attach the graphic here.

Greetings


Don't give up!!
http://webstationone.com/test/htmlarea
Attachments: ed_transparentcolor.gif (75 B)


weedmansteve
Novice

Apr 12, 2004, 11:05 AM

Post #5 of 5 (3816 views)
Shortcut
Re: [Luis] color select outside of HTMLarea [In reply to] Can't Post

Is there a way I can do this, only using the

Code
function Dialog(url, action, init)

or some other cross-browser method so that it works in Mozilla as well?

 
 
 


Search for (options)