TextBox Popup Color Chooser

[Total: 0    Average: 0/5]

This will create a popup window where the user selects a color.

Body Code:

<form name=f1>
<input type=text name=t1 value="default text">
<input type=button onclick=doIt() value="click to open other window">

var _doc ="";
    _doc ="<html><head><title>Choose Color</title></head>";
	_doc+="<a href='javascript:opener.document.f1.t1.style.backgroundColor="red";self.close();'>";
	_doc+="click to make it red</a>";
	_doc+="<a href='javascript:opener.document.f1.t1.style.backgroundColor="green";self.close();'>";
	_doc+="click to make it green</a>";
	_doc+="<a href='javascript:opener.document.f1.t1.style.backgroundColor="blue";self.close();'>";
	_doc+="click to make it blue</a>";
function doIt()
  var _win=window.open();

Times Viewed: 1

Leave a Reply

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