javascript to validate textbox
-
i have text box in datagrig. i want to accept only string characters in text box. how to write java scripte for tht?
Use the onkeypress event. Call a javascript function on this event which chekcs the key code. If this do not want this character return blur()
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
Use the onkeypress event. Call a javascript function on this event which chekcs the key code. If this do not want this character return blur()
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
on click of button i want to validate text box for string means user must have to enter only string textbox name is comment so how i will validate i try to write but thts not working function check() { debugger; var s1=document.getElementById("TextBox1"); var s=s1.value; if(IsNumeric(s)) { alert("Numeric characters are not allowed"); } } not support IsNumeric function
-
on click of button i want to validate text box for string means user must have to enter only string textbox name is comment so how i will validate i try to write but thts not working function check() { debugger; var s1=document.getElementById("TextBox1"); var s=s1.value; if(IsNumeric(s)) { alert("Numeric characters are not allowed"); } } not support IsNumeric function
Use regular expression to validate your input string
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
Use regular expression to validate your input string
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
i want to display alert........with tht i ant show tht if plz sen me tht code of javascript for tht textbox
u can use javascript alert on .cs //---------------javaScript Alert------------------------- public void CreateMessageAlert(System.Web.UI.Page senderpage, string alertMsg) { string alertKey = "alertKey"; string strScript; strScript = "alert('" + alertMsg + "')"; if (!senderpage.IsStartupScriptRegistered(alertKey)) { senderpage.RegisterStartupScript(alertKey, strScript); } } //-------------------------------------------------------- call it like - s = "hello"; CreateMessageAlert(this, s);
Maniiiiiiiiiiiiiii