MinhHuy1977
New Member
I have this java script validation function that fires when the client clicks btnsaveif the text of the text box is empty then a message box is displayed and the focus is on the text box but i cannot seem to prevent the page from posting back when the validation fails AM I missing something. here is my code\[code\]function validate() { var itemscanned; itemscanned = document.getElementById('txtItemCode'); if (itemscanned.value =http://stackoverflow.com/questions/14070137/='') { alert("Plz Enter Item Code"); return false; itemscanned.focus } else { alert(itemscanned.value); } }\[/code\]