Hi,
I have this code:
I just want to add one last piece, which would do this:Code:function validate_form ( ) { valid = true; if ( document.listing.l_id.value == "" ) { alert ( "Please enter a Listing ID!" ); valid = false; } if ( document.listing.a_id.selectedIndex == 0) { alert ( "Please select an Agent!" ); valid = false; } if ( document.listing.category.selectedIndex == 0) { alert ( "Please select an Category!" ); valid = false; } if ( document.listing.price.value == "" ) { alert ( "Please enter a Price!" ); valid = false; } if ( document.listing.price_range.selectedIndex == 0) { alert ( "Please select a Price Range!" ); valid = false; } if ( document.listing.town.selectedIndex == 0) { alert ( "Please select a Town!" ); valid = false; } return valid; }
For some reason that isn't working... can anyone help please?Code:if (valid == "true") { alert ( "The Form Validated Successfully!" ) }



Reply With Quote

Bookmarks