Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

color picker pop up not working

Status
Not open for further replies.

dunskii

Programmer
Sep 14, 2001
107
0
0
AU
hello,

I have a color picker pop up to enable admin to change the color of text etc...i am using an example from a tutorial, the demo works find but when i incorporate it into my site it stops working...

any ways the popup works fine and colors are shown, though when you select a color, the popup stays open and just has a blank bg, the data isn't changed in the targeted field either.

I'm using it with cf if it helps...

here the popup code....

<CFPARAM name="show" default="Other">
<CFIF SHOW IS "close">
<CFSET color = URL.Color>
<CFOUTPUT>
<SCRIPT language="JavaScript1.2" type="text/javascript">parent.opener.document.#Formfield#.
value = '###color#'
parent.window.close()
</SCRIPT>
</CFOUTPUT>
<CFELSE>
<CFSETTING ENABLECFOUTPUTONLY="Yes">

<!--- Set the list of hex Values to use.
Next version will use a loop to determine values --->



<!--- this hex picker looks better visualy,
but DOES NOT contain all the websafe colors --->

<CFSET TheColors = "000000,111111,222222,333333,444444,555555,666666,777777,
888888,999999,AAAAAA,BBBBBB,CCCCCC,DDDDDD,EEEEEE,FFFFFF,
110000,110055,1100AA,1100FF,115500,115555,1155AA,1155FF,
11AA00,11AA55,etc...">

<CFSET TheCount = 0>
<CFSETTING ENABLECFOUTPUTONLY="No">


<cfoutput>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Color Picker</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body bgcolor="##FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">
<TABLE width="100" border="0" cellspacing="0" cellpadding="0" align="center">
<TR>
<TD bgcolor="##OOOOOO">
<TABLE width="100%" border="0" cellspacing="2" cellpadding="0" align="center">
<TR>
<TD colspan="16" align="center" bgcolor="##BBBBBB"><font face="Verdana,Geneva,Arial,Helvetica,sans-serif" size="2"><strong>Click the swatch you would like to use.</strong></font></TD>
</TR>

<!--- Loop over color values and dyanmicly create links and HEX color values --->
<CFLOOP from="1" to="#ListLen(TheColors)#" index="ThisColor"><CFIF TheCount EQ 0><TR></CFIF>
<TD bgcolor="#ListGetAt(TheColors,ThisColor)#" height="18" width="18"><A href="colors.cfm?show=close&Formfield=#URL.Formfield#&
Color=#ListGetAt(TheColors,ThisColor)#"><IMG src="transperent.gif" width="18" height="18" alt="#ListGetAt(TheColors,ThisColor)#" border="0"></A></TD>
<CFIF TheCount EQ 15></TR><CFSET TheCount = 0><CFELSE><CFSET TheCount = TheCount + 1></CFIF></CFLOOP>
</table>
</td>
</tr>
</table>
</cfoutput>
</CFIF>
</body>
</html>


and heres the form code...

<td>Background Colour </td>
<cfparam name="bg_color" default="##000000">
<td><input type="text" name="bg_color" value="<cfoutput>#bg_color#</cfoutput>" size="15">
<A href="##" onclick="Javascript: window.open('colors.cfm?Formfield=EditColors.bg_color',
'DefColor','width=324,height=340,location=No,menubar=No,
scrollbars=no,status=no,toolbar=No,resizable=yes');">Change Color</A>
</td>


tahnks for your help

AD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top