validation for java script in dropdownlist box?

Posted by Chandru_ra under ASP.NET on 3/21/2011 | Points: 10 | Views : 1875 | Status : [Member] | Replies : 1
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

Posted by: Sathya4260 on: 3/22/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

In dropdown List at " -ALL-" set selected=true;

Hope this helps

Sathish Kumar S

Chandru_ra, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response