Hi,
if your alert shows
ctl00_ContentPlaceHolder1_gridCategory_ctl02_txtCourseCategory
then do not use the server tag <%=... %> just use
perobj itself like
function validate(perobj, stockobj) {
document.getElementById(perobj).style.display = 'none';
}
hope this will work.