what is wrong with this javascript with jsp - asap help needed
<script language="javascript">
function checkSubmit(form){
// Loop from zero to the one minus the number of radio button selections
for (counter=0; counter < document.submitform.authortitle.length; counter++){
if (form.authortitle[counter].checked){
var splitStr = document.submitform.authortitle[counter].value;
alert(splitStr);
var splitStrArray =new Array();
splitStrArray = splitStr.split(","); alert(splitStrArray[2]);
splitStrArray[2].trim();
if(splitStrArray[2].equals("null")){
alert("true");
//replace the form action with somefile.jsp
document.forms[0].action="searchAmazon.jsp";
form.submit();
}else{
document.forms[0].action="isbnSearch.jsp";
form.submit();
}
}
}
}
</script>
the above javascript method is acting stupid.. it shows the first two alerts but does not go in the if statement "if(splitStrArray[2].equals("null")){ " and does not show the third alert. i do not c any problems pls help... when i click the option and submit it gives me a jasper exception pointing to some line which does not involve this code...

