for (var i=0; i <= 20; i++) // where DCtrlCounter is the number of textbox you want to validate { var txtbox = document.getElementById("Textbox"+i) if (txtbox) { if (txtbox.value == "") { alert("Serial Number field cannot be empty"); return false; } } }
string tmp = txtbox.value.Trim(); if (tmp == "") { // Your code }
trim()
if( txtbox.value != null && txtbox.value.trim() =="") { alert("Serial Number field cannot be empty"); return false; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)