473,699 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

validate numeric field

I done a numeric field checking as below, but I found that if I insert
float number (10.01), it validate it as non numeric and return false..
What is going wrong?

if (!isNumeric(doc ument.frmA.f1.v alue)) {
alert("Please fill in Numeric")docume nt.frmA.f1.valu e=""
document.frmA.f 1.focus()
return false;
}

Mar 3 '06 #1
7 6744
Zif
juicy wrote:
I done a numeric field checking as below, but I found that if I insert
float number (10.01), it validate it as non numeric and return false..
What is going wrong?

if (!isNumeric(doc ument.frmA.f1.v alue)) {
alert("Please fill in Numeric")docume nt.frmA.f1.valu e=""
document.frmA.f 1.focus()
return false;
}


The isNumeric() function thinks it is 'non numeric'.

If you post the code for it, or a link, you might get more help.
Hopefully it is better presented than the ugly snippet posted above.

--
Zif
Mar 3 '06 #2
I got the solution, should be isMoney() and not isNumeric().

Mar 4 '06 #3
juicy wrote on 04 mrt 2006 in comp.lang.javas cript:
I got the solution, should be isMoney() and not isNumeric().


Next to eval(), money is the root of all evil.

Do you infer isMoney() is basic javascript?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 4 '06 #4
JRS: In article <Xn************ ********@194.10 9.133.242>, dated Sat, 4
Mar 2006 10:18:38 remote, seen in news:comp.lang. javascript, Evertjan.
<ex************ **@interxnl.net > posted :
juicy wrote on 04 mrt 2006 in comp.lang.javas cript:
I got the solution, should be isMoney() and not isNumeric().


Next to eval(), money is the root of all evil.

Do you infer isMoney() is basic javascript?


<FAQENTRY> The string "valid" occurs nowhere in the newsgroup FAQ. That
should be remedied. </FAQENTRY>

OP : see <URL:http://www.merlyn.demo n.co.uk/js-valid.htm>.

Re <FAQ**TRY> : ISTM over-optimistic to expect all responders to make
the change. But if originators are requested to put <FAQENTRY> at the
beginning of a line, then most will comply if only "accidental ly". The
routine that searches for <FAQ..TRY> can then be modified to search with
/^\s*<FAQE..RY>. and should find predominantly the originals.

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Mar 5 '06 #5
Dr John Stockton wrote on 04 mrt 2006 in comp.lang.javas cript:
JRS: In article <Xn************ ********@194.10 9.133.242>, dated Sat, 4
Mar 2006 10:18:38 remote, seen in news:comp.lang. javascript, Evertjan.
<ex************ **@interxnl.net > posted :
juicy wrote on 04 mrt 2006 in comp.lang.javas cript:
I got the solution, should be isMoney() and not isNumeric().


Next to eval(), money is the root of all evil.

Do you infer isMoney() is basic javascript?


<FAQENTRY> The string "valid" occurs nowhere in the newsgroup FAQ. That
should be remedied. </FAQENTRY>

OP : see <URL:http://www.merlyn.demo n.co.uk/js-valid.htm>.

Re <FAQ**TRY> : ISTM over-optimistic to expect all responders to make
the change. But if originators are requested to put <FAQENTRY> at the
beginning of a line, then most will comply if only "accidental ly". The
routine that searches for <FAQ..TRY> can then be modified to search with
/^\s*<FAQE..RY>. and should find predominantly the originals.


Uh???

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 5 '06 #6
JRS: In article <Xn************ ********@194.10 9.133.242>, dated Sun, 5
Mar 2006 16:42:06 remote, seen in news:comp.lang. javascript, Evertjan.
<ex************ **@interxnl.net > posted :
Dr John Stockton wrote on 04 mrt 2006 in comp.lang.javas cript:

Re <FAQ**TRY> : ISTM over-optimistic to expect all responders to make
the change. But if originators are requested to put <FAQENTRY> at the
beginning of a line, then most will comply if only "accidental ly". The
routine that searches for <FAQ..TRY> can then be modified to search with
/^\s*<FAQE..RY>. and should find predominantly the originals.


Uh???


Read the FAQ to the end, and you will understand. The penultimate full
stop should have been a slash.

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Mar 5 '06 #7
Dr John Stockton wrote on 05 mrt 2006 in comp.lang.javas cript:
predominantly the originals.


Uh???


Read the FAQ to the end, and you will understand. The penultimate
full stop should have been a slash.

I see, you wouldn't mean
the predominantly slashed penultimate ab-originals?

And that in rhyme! It should be the slogan of this NG:

Read the FAQ to the end,
and you will understand,
what I ment.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 6 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2110
by: Hernán Castelo | last post by:
hi should i validate cookies values? thanks -- atte, Hernán Castelo SGA - UTN - FRBA
5
4254
by: Rob Wahmann | last post by:
Not sure if my first message went through because of the attachment... I'm currently using formchek.js to validate various form fields, however, I cannot figure out how to validate a field with a numeric range of 6-10 digits. I apologize in advance for asking such a question since I'm using formchek.js, but my strength is server-side programming not JavaScript. I appreciate any tips or advice you can provide! TIA - Rob
5
1647
by: Nuria | last post by:
Helow I have a Combo-box where the user can select an item of the storehouse, after that, the user can indicate the quantity of items that go out. I want to validate that the quantity of items do not exceed of the quantity of items in the storehouse. I have that:
1
2990
by: Grey | last post by:
Can I use RegularExpressionValidator to validate the user is input number or not? how to do that???
3
2738
by: George Eapen | last post by:
Hi all, i want to check whether a value entered into a specific html field is numeric as well as should contain one decimal value.( eg.23 is not accepted..It should be 23.0) i have come up with a code which checks whether the value is numeric or not. But how can i check for decimal place..Any one who can help me on this? Thanks in Advance
4
2695
by: somuchbetta | last post by:
Hiya, Does anyone know any simple JScript code to validate a numeric field and also the length of the data that should be entered into the field. e.g. 12345 - the user can only enter numeric fields and the lenght of the value should be five (no more and no less) Thanks
1
3133
by: saravanatmm | last post by:
I need javascript code for validate the email address. Email address field cannot allowed the capital letters, special characters except '@' symbol. But can allowed the small letters, numeric numbers. Now i use this script for validate the email address. But it allows the cpital letters otherwise its working correctly. SCRIPT FUNCTION ************************************************
0
1411
by: =?Utf-8?B?YyMganVua2ll?= | last post by:
Title says it ... my C# web application uses a number of FormViews that are inserted/updated/deleted via stored procedures. Is there a way thru C# coding (example?) to validate a date field as valid input before inserting/updating? Test the length of a varchar/char field? Validate an int field as valid numeric input (no alpha) ... and so on? I would like to do this validation before the stored procedures fire (perhaps stopping), of...
8
6633
idsanjeev
by: idsanjeev | last post by:
I try to validate inpute field for weight that accept only numeric value like 65.12 not allow any special character or character but allow '.' . thanks jha
0
8612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.