Alright, having some issues

.
Here's what I have so far. Here's the form:
[html]
<form method="post" action="doit.php" name="content">
<p><label id="datBegin">Date</label><br />
<input type="text" id="date" name="date" value="<?php echo date('F d, Y'); ?>" />
<input type="hidden" id="time" name="time" value="<?php date('H:i:s'); ?>" /></p>
<p><label id="category">Category</label><br />
<select id="category" name="category" onchange="changeNewCat()">
<optgroup label="Please Pick">
<option value="0">No Category Selected</option>
<?php
$i=0;
while ($i<$num) {
$row = mysql_fetch_assoc($result);
echo "<option value=".$row['category'].">".$row['category']."</option>";
$i++;
}
?>
</optgroup>
</select> OR
<input type="text" id="newcat" name="newcat" /> (Add a new category)</p>
<p><label id="daily">Content</label><br />
<textarea id="daily" name="daily"></textarea></p>
<input type="submit" value="Create Daily" onclick="return checkForm(this.form)" />
</form>
[/html]
First off, don't worry about the PHP. This all works. Also, the
onchange="changeNewCat()" works great too.
Let me give you javascript before I go further into this:
// Trying to code up a duplicate stopper!!
var dropdowns = document.getElementsByName("category");
var newCatDrop = document.forms[0].newcat.value;
for(var i = 0; i < dropdowns.value; i++) {
if (i == newCatDrop) {
alert("Sorry, no duplicates allowed.");
return false;
}
else {
// For debugging purposes, will remove later.
alert("No Match");
return false;
}
}
The javascript just doesn't work. Theres is more to this. Also, don't worry about the part that says
onclick="return checkForm(this.form)". The above javascript is a snippet, as this all works, except for the javascript stated above.
Am I not iterating properly. If someone could guide me or show me a little better way of getting this done, please do show.
I believe this is the last part of the validation of this form and it will be complete.
Any thoughts?