psgbuilder
12-06-2008, 06:36 PM
I am trying to write color values to 2 hidden form fields.
There are a total of 21 different colors in the actual application which is a product configurator.
Customer selects and sees his color choices before submitting the form.
Sometimes the customer's choice is a single solid color other times it is 2-tone.
The basic code so far looks like this:
<ul>
<li><a href="javascript::" onClick="document.form1.color1.value='black';document.form1.color2.value='black'">black color1 and color2</a></li>
<li><a href="javascript::" onClick="document.form1.color1.value='green';document.form1.color2.value='green'">green color1 and color2</a></li>
<li><a href="javascript::" onClick="document.form1.color1.value='blue';document.form1.color2.value='yellow'">blue color1 and yellow color2</a></li>
</ul>
<form name="form1" method="post" action="">
<input name="color1" type="hidden" value="" >
<input name="color2" type="hidden" value="" >
</form>
If I change the type to text this works correctly.
Unfortunately, it does not seem to work for hidden fields.
I would appreciate any help.
(I suppose I could use CSS display:none to hide the text box but that seems rather cludgy)
(Alternatively, I could allow the display and prevent direct user input by putting an empty layer over the box)
There are a total of 21 different colors in the actual application which is a product configurator.
Customer selects and sees his color choices before submitting the form.
Sometimes the customer's choice is a single solid color other times it is 2-tone.
The basic code so far looks like this:
<ul>
<li><a href="javascript::" onClick="document.form1.color1.value='black';document.form1.color2.value='black'">black color1 and color2</a></li>
<li><a href="javascript::" onClick="document.form1.color1.value='green';document.form1.color2.value='green'">green color1 and color2</a></li>
<li><a href="javascript::" onClick="document.form1.color1.value='blue';document.form1.color2.value='yellow'">blue color1 and yellow color2</a></li>
</ul>
<form name="form1" method="post" action="">
<input name="color1" type="hidden" value="" >
<input name="color2" type="hidden" value="" >
</form>
If I change the type to text this works correctly.
Unfortunately, it does not seem to work for hidden fields.
I would appreciate any help.
(I suppose I could use CSS display:none to hide the text box but that seems rather cludgy)
(Alternatively, I could allow the display and prevent direct user input by putting an empty layer over the box)