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: Omitting Pound (#) Sign
ekautz
Newbie

Posts: 1
Registered: 7/31/2003
Member Is Offline
posted on 7/31/2003 at 06:02 PM Reply With Quote
Omitting Pound (#) Sign


Excellent color picker!

Is there already a way to toggle the pound sign (#) on and off for the popup and final text field color value? I quickly scanned your code but didn't see anything obvious so...

To picker.js I added the variables

var PUpsign;
var TFpsign;

and added two parameters and two lines to this function

function TCPopup(field, palette, ppsign, tpsign) {
PUpsign = !ppsign || ppsign == 0? '' : '#';
TFpsign = !tpsign || tpsign == 0? '' : '#';

and modified

function TCSelect(c) {
this.field.value = '#' + c.toUpperCase();

to

function TCSelect(c) {
this.field.value = TFpsign + c.toUpperCase();

and

function TCPaint(c, b_noPref) {
c = (b_noPref ? '' : '#') + c.toUpperCase();

to

function TCPaint(c, b_noPref) {
c = (b_noPref ? '' : PUpsign) + c.toUpperCase();

then I modified the main function call by adding the two new parameters

<a href="javascript:TCP.popup(document.forms['request2'].elements['color'],0,1,0)">

where 0 = omitting # and > 0 = adding #

The first parameter is to toggle the # sign for the popup and the second parameter is to toggle the text field value

Now I can easily save just the number values to my database field when needed without the #

I tried to use

PUpsign = !ppsign || ppsign >= 1? '#' : '';
TFpsign = !tpsign || tpsign >= 1? '# : '';

so if the parameters where not used then it would default to # but I couldn't get that work??? always picked up the #
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