473,466 Members | 1,406 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Javascript Code for Not accepting Zero when entered alone in a Text Box

nitindel
67 New Member
Hi,
I have a text Box and want to apply javascript validation for not accpting Only Zero(s). For eg. If i enter 002308 ,it should accept but if enter 00000 or any number of Zeros alone ,it shold throw Error..

Please tell.It's Urgent.

Thanks & Regards
Nitin Sharma
Dec 18 '07 #1
3 2416
Shashi Sadasivan
1,435 Recognized Expert Top Contributor
Hi,
I have a text Box and want to apply javascript validation for not accpting Only Zero(s). For eg. If i enter 002308 ,it should accept but if enter 00000 or any number of Zeros alone ,it shold throw Error..

Please tell.It's Urgent.

Thanks & Regards
Nitin Sharma
Hi nitindel
Welcome to TSDN.

Please post your questions in the right forum so that you can recieve a more quicker and better resposnce from the experts residing in that Forum.

-Shashi
Dec 18 '07 #2
nitindel
67 New Member
Hi nitindel
Welcome to TSDN.

Please post your questions in the right forum so that you can recieve a more quicker and better resposnce from the experts residing in that Forum.

-Shashi
Sure ...I will take care from noe onwards...
Please tell the solution now...

Thnaks in Advance
Nitin Sharma
Dec 18 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
I have a text Box and want to apply javascript validation for not accpting Only Zero(s). For eg. If i enter 002308 ,it should accept but if enter 00000 or any number of Zeros alone ,it shold throw Error..
Use a regular expression, e.g. /^[0]+$/ should match all zeros only. See this link on how to use regular expressions in JavaScript.
Dec 18 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
5
by: Tony Strazzeri | last post by:
Hi all, I a fairly new to html and Javascripting. I have been trying to write some code to hide my email address from spam harvesters. I copied the code from various web examples and modified...
2
by: GGerard | last post by:
Hello I have an Inventory text box in a datasheet that has the Control Source property set to =* and the Format property set to Currency. The datasheet is linked to the Stock table that has the...
16
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I protect my javascript code? ----------------------------------------------------------------------- ...
31
by: ajos | last post by:
hi frnds, i have a form,which has 2 input text boxes, the values are entering the text boxes,when i leave the 2 text boxes blank and hit submit a java script gives the message that the 2 fields are...
5
by: sunarb | last post by:
Accepting the String in normal text box and checking weather the srting is Date or not in javascrit
13
by: sarega | last post by:
Hi, Here am trying to populate the page with new url, with the value that is being entered in the text box. this is the php code called example.php <? echo "<input type='text' name='text1'...
4
by: sarega | last post by:
Hi, I have a text box, when a user enters some value into the text box, that value has to be populated in the url and as well as the value entered in that text box has to be retained. <? echo...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
1
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...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.