Hello All!
I’m very new to HTML, JavaScript, PHP, etc. I am practically a newbie, but I’m a quick learner. I’m creating a page that will have various colors listed as checkboxes. I want to limit the number of choices to 2 colors per order. How do I right the code for that? I have searched throughout the Internet and have not located what I’m looking for.
Also, if the customer does try to make more than 2 selections I would like to create an alert, or warning, or something that will pop-up and state they have exceeded their limit or something to that effect.
Help please ? I have included the code at the bottom.
<html>
<body>
Vander Light Candles – Colors
<br>
***Limit 2 choices
<table border=”0″ width=”50%” cellpadding=”10″>
<tr>
<td width=”30%” valign=”top”>
<form action=””>
Baby Blue
<input type=”checkbox” name=”colors” value=”Baby Blue”/>
<br>
Black
<input type=”checkbox” name=”colors” value=”Black”/>
<br>
Blue
<input type=”checkbox” name=”colors” value=”Blue”/>
<br>
Bright Yellow
<input type=”checkbox” name=”colors” value=”Bright Yellow”/>
<br>
Brown
<input type=”checkbox” name=”colors” value=”Brown”/>
<br>
Burgundy
<input type=”checkbox” name=”colors” value=”Burgundy”/>
<br>
Cinnamon Spice
<input type=”checkbox” name=”embeds” value=”Cinnamon Spice”/>
</td>
<td width=”30%” valign=”top”>
<form action=””>
Clear
<input type=”checkbox” name=”colors” value=”Clear”/>
<br>
Golden Yellow
<input type=”checkbox” name=”colors” value=”Golden Yellow”/>
<br>
Hunter Green
<input type=”checkbox” name=”colors” value=”Hunter Green”/>
<br>
Kelly Green
<input type=”checkbox” name=”colors” value=”kelly Green”/>
<br>
Light Purple
<input type=”checkbox” name=”colors” value=”Light Purple”/>
<br>
Magenta
<input type=”checkbox” name=”colors” value=”Magenta”/>
<br>
Navy Blue
<input type=”checkbox” name=”colors” value=”Navy Blue”/>
</td>
<td width=”30%” valign=”top”>
<form action=””>
Orange
<input type=”checkbox” name=”colors” value=”Orange”/>
<br>
Peach
<input type=”checkbox” name=”colors” value=”Peach”/>
<br>
Pink
<input type=”checkbox” name=”colors” value=”Pink”/>
<br>
Pumpkin Spice
<input type=”checkbox” name=”colors” value=”Pumpkin Spice”/>
<br>
Purple
<input type=”checkbox” name=”colors” value=”Purple”/>
<br>
Red
<input type=”checkbox” name=”colors” value=”Red”/>
<br>
Teal
<input type=”checkbox” name=”colors” value=”Teal”/>
</tr>
</table>
</body>
</html>