Colorpop

[Total: 0    Average: 0/5]

This script opens a popup color chart when the “chart” buttons are clicked.

Head Code:

<!--
*************************************************************************************
**  Copyright Notice                                                               **
**  ColorPop v1.0 is written by David Clements                                     **
**  Copyright(pending) 2002 David Clements. All Rights Reserved.                   **
**  This script is free to use and alter as much as you like.                      **
**  You may not resell or redistribute this script without permission.             **
**  You may not pass the script off as your own work.                              **
**  You must leave this notice intact.                                             **
**  You may place a link to http://www.barefootc.com/ on your web site.            **
**  If you find any bugs with this script, please e-mail me at dave@barefootc.com  **
*************************************************************************************
-->

<script language="javascript">
var win= null;

function NewWindow(fieldName)
{
// Save the name of the target input field to the hidden input
document.form1.fieldName.value=fieldName

// Opens the Color Chart Popup
win2=window.open('/data/ex_938/popup.html','colorPop','height=130,width=274,top=150,left=100,scrollbars=no,resizable=no');
}

function doIt(color)
{
// Get the selected color and send it to the target input field
eval('document.form1.' + document.form1.fieldName.value + '.value='' + color + ''');
}

</script>

Body Code:

<form id=form1 name=form1>
<input type="hidden" name="fieldName" value="">
<br><br>

<table width="400" align="center" border="2">
   <tr>
      <td align="center">
         <b>Click the button to open the color chart</b>

         <table width="200" align="center" border="0">
            <tr>
               <td align="right">
                  <b>Color 1: </b>
                  <input type="text" name="color1" value="" size="7">
               </td>
               <td align="center" valign="bottom">
                  <small><input type="button" name="testClr1" value="Chart" onclick="NewWindow('color1');return false" style="font-size:12"></small>
               </td>
            </tr>
            <tr>
               <td align="right">
                  <b>Color 2: </b>
                  <input type="text" name="color2" value="" size="7">
               </td>
               <td align="center" valign="bottom">
                  <small><input type="button" name="testClr2" value="Chart" onclick="NewWindow('color2');return false" style="font-size:12"></small>
               </td>
            </tr>
            <tr>
               <td align="right">
                  <b>Color 3: </b>
                  <input type="text" name="color3" value="" size="7">
               </td>
               <td align="center" valign="bottom">
                  <small><input type="button" name="testClr3" value="Chart" onclick="NewWindow('color3');return false" style="font-size:12"></small>
               </td>
            </tr>
            <tr>
               <td>
                  &nbsp;
               </td>
               <td align="center" valign="bottom" height="30">
                  <small><input type="reset" name="reset" value="Reset" style="font-size:12"></small>
               </td>
            </tr>
         </table>
      </td>
   </tr>
</table>
</form>

Times Viewed: 2

Leave a Reply

Your email address will not be published. Required fields are marked *