views:

23

answers:

1

Hey, help would be very much appreciated. How do I make an ifstatement so both of these fields "szValue" and "szPara" clear onSubmit? Thanks!

function submit() 
{     
    if (document.getElementById('szValue').value === "Enter First Value")
    {
        document.getElementById('szValue').value = "";
    }

    if (document.getElementById('szPara').value === "Enter Second Value")
    {      
        document.getElementById('szPara').value = "";
    }

    document.searchForm.submit();
}
A: 
rahul
Thanks Rahul. I actually had the quotes in the right place in the code, but when I edited it for here left it out. You can put two consecutive if statements in there like that, though?
Brian K