how to use java script using dropdownlist box?

Posted by Chandru_ra under ASP.NET on 3/21/2011 | Points: 10 | Views : 1288 | Status : [Member] | Replies : 0
Dear all,
am using this code for validation but not accessble for validate..
function validatepost()
{
try
var varddlexamterms=document.getElementById("ddlexamterm");
var selectedterm=varddlexamterms.options[varddlexamterms.selectedIndex].value;
if(varddlexamterm.value="-All-") //supose you want to disable the item numbered 2
{
setTimeout("__doPostBack('ddlexamterm','')", "-All-");
alert('Pls select Exam Term!');
ddlexamterm.focus();
return false;
}
return true;
}
catch(e)
{
return false;
}
}

chandru


Responses

(No response found.)

Login to post response