[thelist] Select box validation

Jay Fitzgerald jayfitz at bayou.com
Fri Nov 5 09:14:06 CST 2004

I am getting the JS alert box on the code below; but it is not placing 
the borderstyle around the select box:

<form method="post" action="step2.php" name="step1" id="step1" 
enctype="multipart/form-data" onSubmit="return checkstep1();">

<select id="mm" name="mm">
<option value="00">-- Month --</option>
<option value="01">January</option>
<option value="02">February</option>
<option value="03">March</option>
<option value="04">April</option>
<option value="05">May</option>
<option value="06">June</option>
<option value="07">July</option>
<option value="08">August</option>
<option value="09">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>

<input type="submit" value="Continue">

function checkstep1()
var mm = document.getElementById('mm');
var borderstyle = '2px solid #FF0000';

if(mm.value = "00") {
alert('Please select the month you where born.');
mm.style.border = borderstyle;
return false;

Jay Fitzgerald, Design Director
• Certified Professional Webmaster (CPW-A)
• Certified Professional Web Designer (CPWDS-A)
• Certified Professional Web Developer (CPWDV-A)
• Certified E-Commerce Manager (CECM-A)
• Certified Small Business Web Consultant (CWCSB-A)

Bayou Internet - http://www.bayou.com
Toll Free: 888.30.BAYOU (22968)
Vox: 318.338.2034 / Fax: 318.338.2506
E-Mail: jayfitz at bayou.com

ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf

More information about the thelist mailing list