case "color": // handles colors $field_html .='<input type="color" name="tv'.$field_name.'" '.$field_style.' onclick="documentDirty=true;setVariableModified(\''.$field_name.'\');" /><br>'; $field_html .='<script type="text/javascript" src="media/colorpic/picker.js"></script>'; $field_html .='</script>'; $field_html .='<a href="javascript:TCP.popup(document.forms['formname'].elements['"tv'.$field_name.'"'])"><img width="15" height="13" border="0" alt="Click Here to Pick up the color" src="img/sel.gif"></a> break;
<option value="color" <?php echo ($content['type']=='color')? "selected='selected'":""; ?>>Color Picker</option>
case "color": // handles colors $field_html .='<input type="text" name="tv'.$field_name.'" value="'.$field_value .'" '.$field_style.' onclick="documentDirty=true;setVariableModified(\''.$field_name.'\');" /><br>'; $field_html .='<script type="text/javascript" src="media/colorpic/picker.js"></script>'; $field_html .='</script>'; $field_html .='<a href="javascript:TCP.popup(document.forms[\'mutate\'].elements[\'tv'.$field_name.'\'])"><img width="15" height="13" border="0" alt="Click Here to Pick up the color" src="media/colorpic/sel.gif"></a> '; break;
mm but somehow it does not save this setting on the computers I have tryed it on
but on another machiene my friend has it does work.
ok when there is no default string set i can enter somting by hand and it will save but when i use the colorpicker it will not save the string
and also when there is a default string set it wil not save and keep the default string.
it looks like i need to manualy be active in this field to make it work somehow
it only works when i'v bin active in the field manualy that all the cases above work
could somthing be missing?
all other tv's work with no problem
You need to call invoke the onchange event of the textbox.
For example:
textbox.onchange(), where textbox if the form element used in your color picker
This will flag that TV as a modified variable.
case "color": // handles colors $field_html .='<input type="text" name="tv'.$field_name.'" value="'.$field_value .'" '.$field_style.' onclick="documentDirty=true;setVariableModified(\''.$field_name.'\');" /><br>'; $field_html .='<script type="text/javascript" src="media/colorpic/picker.js"></script>'; $field_html .='</script>'; $field_html .='<a href="javascript:TCP.popup(document.forms[\'mutate\'].elements[\'tv'.$field_name.'\'])"><img width="15" height="13" border="0" alt="Click Here to Pick up the color" src="media/colorpic/sel.gif"></a> '; break;