On my dropdownlist, I set it up so the onchange should call checkval and pass in the id of element. I just started off with really basic login, but cant even get the alert to display. What am I doing wrong?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script>
function checkval(id){
if($('#' + id).val == "Other")
{
alert("You Selected Other");
//other logic will go here
}
}
</script>
</head>
<body>
<select name="items1[]" id="items1[]" onchange="checkval(id);">
<option selected value="">Select One</option>
<option value="one">One</option>
<option value="Other">Other</option>
</select>
<select name="items2[]" id="items2[]" onchange="checkval(id);">
<option selected value="">Select One</option>
<option value="one">One</option>
<option value="Other">Other</option>
</select>
</body>
</html>