Here is my code
<%@ Language=JavaScript %>
<% Response.Buffer = true %>
<% Response.Expires = 0 %>
<HTML>
<HEAD>
<link REL="stylesheet" TYPE="text/css" HREF="SiteStyles.css">
<SCRIPT LANGUAGE="JavaScript">
function CheckThis()
{
alert(parseFloat(document.Form1.Text1.value)+ "\t" + isNaN(parseFloat(document.Form1.Text1.value)));
}
</SCRIPT>
<FORM name='Form1' >
<INPUT name='Text1' >
<INPUT name='Submit' type='Button' value='Click Me' onClick='javascript:CheckThis();' >
</FORM>
</HTML>
1. value in Text1 1.2 alert 1.2 false
2. Text1.value = 1.2a alert 1.2 false
3. Text1.value = 1.a2b3 alert 1 fasle
What i am doing wrong here and how can i check if value in the textbox is number, or i have to write my own validation function
I use IE5 on Win2k ASP.
Any help would be greatly appreciated.
Thanks
<%@ Language=JavaScript %>
<% Response.Buffer = true %>
<% Response.Expires = 0 %>
<HTML>
<HEAD>
<link REL="stylesheet" TYPE="text/css" HREF="SiteStyles.css">
<SCRIPT LANGUAGE="JavaScript">
function CheckThis()
{
alert(parseFloat(document.Form1.Text1.value)+ "\t" + isNaN(parseFloat(document.Form1.Text1.value)));
}
</SCRIPT>
<FORM name='Form1' >
<INPUT name='Text1' >
<INPUT name='Submit' type='Button' value='Click Me' onClick='javascript:CheckThis();' >
</FORM>
</HTML>
1. value in Text1 1.2 alert 1.2 false
2. Text1.value = 1.2a alert 1.2 false
3. Text1.value = 1.a2b3 alert 1 fasle
What i am doing wrong here and how can i check if value in the textbox is number, or i have to write my own validation function
I use IE5 on Win2k ASP.
Any help would be greatly appreciated.
Thanks