Quantcast

Maximum PC

It is currently Mon May 20, 2013 9:03 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: "Dynamic" HTML Color Table(s)
PostPosted: Wed Jul 26, 2006 4:40 am 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11602
I am working on one because I always seem to never be able to find the color that I want... SO...

http://www.daobesys.com/color.asp
http://www.daobesys.com/color.asp?order=2

I have another version of it that I am working on... so this is a WIP for now. Should be handy to have though.


Top
  Profile  
 
 Post subject:
PostPosted: Sat Jul 29, 2006 1:19 pm 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Thu Jul 22, 2004 11:11 am
Posts: 5104
Location: RFC 1149 - Pidgeon Network
Hey, started playing around in javascript again, but It's difficult. I'm trying to limit myself to methods that work in both ie AND firefox, without having to check to versions and write the same thing twice. Real lack of editors out there it seems for js. Ah well. Just doing this to get back into the swing but i've encountered one annoyance - well several.

onclick for buttons doesnt work in firefox, I have to use a return
onclick="recompute(); return false;"

then i found out my radio buttons can't be read normally
Code:
if (corn[0].checked){
        ulr=document.getElementById("vred").value;
        ulg=document.getElementById("vgrn").value;
        ulb=document.getElementById("vblu").value;         
      }


Using ie it works, using firefox, I get "corn not defined" using the javascript console. Anyone know how i'm suppossed to access a radio button's value in firefox js?

http://beomagi.ath.cx/colorpicker.html


Top
  Profile  
 
 Post subject:
PostPosted: Sat Jul 29, 2006 1:44 pm 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Thu Jul 22, 2004 11:11 am
Posts: 5104
Location: RFC 1149 - Pidgeon Network
EUREKA!

Code:
if (document.getElementById("cn1").checked){
        ulr=document.getElementById("vred").value;
        ulg=document.getElementById("vgrn").value;
        ulb=document.getElementById("vblu").value;         
      }


where each radiobutton has a different id- name="corn" but id="cn1".."cn4" horrible way to do it if it's a long array, but this seems to work for now.


Top
  Profile  
 
 Post subject:
PostPosted: Mon Jul 31, 2006 6:13 am 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11602
Beomagi wrote:
EUREKA!

Code:
if (document.getElementById("cn1").checked){
        ulr=document.getElementById("vred").value;
        ulg=document.getElementById("vgrn").value;
        ulb=document.getElementById("vblu").value;         
      }


where each radiobutton has a different id- name="corn" but id="cn1".."cn4" horrible way to do it if it's a long array, but this seems to work for now.


Yep. that is how most radio button collections work... I think in .NET there is a control that actually is a collection of radiobuttons (radio button list) and I think you can access them by their numerical index.

I do have a Javascript version of this page, but this one is written in pure classic ASP. It runs faster as it is handled server-side rather than client side. It works better for this as it doesn't require any client interaction to generate the table as your color picker would do.


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group