I want to validate a text box which is inside usercontrol using javascriptplease find the below code.<script type="text/javascript"> debugger function checkEmpty() { var eleName = GetClientId('txtName'); if (document.getElementByID('eleName').value = '') { alert('Enter name'); return false; }}function GetClientId(strid){ var count=document.forms [ 0 ] . length ; var i = 0 ; var eleName; for (i = 0 ; i < count ; i++ ) { eleName = document.forms [ 0 ] . elements [ i ] .id; pos=eleName.indexOf ( strid ) ; if(pos >= 0) break; } return eleName; } 解决方案 这篇关于在Javascript上出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-19 19:56