View Full Version : Form validator Issue

01-28-2008, 06:16 PM
I have the following code that validates a select box I have. It works but I want to change it to check two select boxes and also it still submits the form after the alert comes up.

<input name="submit" type="submit" value="Post Question" onclick="madeSelection(document.getElementById('forums'), 'Please Choose a forum sub category')" />

<script type='text/javascript'>
function madeSelection(elem, helperMsg){
if(elem.value == 'Please Choose'){
return false;
return true;

Philip M
01-28-2008, 07:04 PM
<input name="submit" type="submit" value="Post Question" onclick="return madeSelection(document.getElementById('forums'), 'Please Choose a forum sub category')" />

01-28-2008, 07:21 PM
How can I make it so that it will validate two select boxes?