[thelist] JavaScript Select box validation style problem

Jay Fitzgerald jayfitz at bayou.com
Fri Nov 5 11:00:55 CST 2004


Yes, I found that placing borders around select boxes does not work...so 
now I am trying to change the background color and font color of the 
first option in my select box if the validation fails:

function checkstep1()
{
    var mm = document.step1.mm;
    var backgroundColor = '#ff0000';
    var color = '#ffffff';

    if(mm.options[mm.selectedIndex].value = "00")
    {
        alert('Please select the month');
        mm.options[mm.selectedIndex].style = backgroundColor;
        mm.options[mm.selectedIndex].style = color;
        return false;
    }

but I am doing this correctly. It sortof validates the form because it 
gives the JS Alert box; but it still process the form and goes to the 
next page and it soent stop and set the background and font colors

Any help is appreciated.

Jay



More information about the thelist mailing list