Initially i was trying to validate a user input when i stumbled with a problem is that i cant fix the cursor of the focus on an element when focusing out. this is the code
$("#ChapterCode").keydown(function(e){
if(e.keyCode==9 || e.keyCode==13){
if($(this).val()!=""){
ChapterCode();
get_fees();
return true;
}else{
$(this).focus();
return false;
}
}
});
this will work as return false will prohibit the focus from changing when clicking a TAB. however
$("#ChapterCode").focusout(function(e){
if($(this).val()!=""){
ChapterCode();
get_fees();
return true;
}else{
e.preventDefault();
$(this).focus();
return false;
}
});
this wont work same as for blur any help ? i added e.preventDefault(); knowing that it wont work just in case. Help is really appreciated thanks again. Please dont tell me to create an error message or something like that coz its simply out of the question.