Javascript for Space validation ?
-
I use the below code for null checking.. if (document.getElementById("<%=txtHeading.ClientID%>").value=="") { alert("Enter News Heading"); } But when the user hit the space button , it become false.. So. Give me the code for chking One or more space through js ? Got ?Give..
-
I use the below code for null checking.. if (document.getElementById("<%=txtHeading.ClientID%>").value=="") { alert("Enter News Heading"); } But when the user hit the space button , it become false.. So. Give me the code for chking One or more space through js ? Got ?Give..
You must trim the string
if (trim(document.getElementById("<%=txtHeading.ClientID%>").value)=="") { alert("Enter News Heading"); } function trim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g,""); }
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
-
You must trim the string
if (trim(document.getElementById("<%=txtHeading.ClientID%>").value)=="") { alert("Enter News Heading"); } function trim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g,""); }
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
Thanks for ur solution
-
I use the below code for null checking.. if (document.getElementById("<%=txtHeading.ClientID%>").value=="") { alert("Enter News Heading"); } But when the user hit the space button , it become false.. So. Give me the code for chking One or more space through js ? Got ?Give..
Use a
RequiredFieldValidator
. It don't allow spaces.All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
Use a
RequiredFieldValidator
. It don't allow spaces.All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
great :)
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.