Webmaster Forum Rules | Posting Guide | Contact Us | Testimonials | Contributing Geek Program | Advertise on Geek/Talk
Welcome to the GeekTalk Webmaster Discussion Forums from GeekVillage.com

Click Here To Register. It's Free!

Go Back   geek/talk: Signature-free discourse for serious web publishers > YOUR CREATION: Building & Maintaining A Web Site > Web Development - Programming / Coding
User Name
Password
Register FAQ Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 08-26-2011, 05:35 AM   #1
ziaht
Member.
 
Join Date: Aug 2011
Posts: 59
Default How to create validation check for numbers?

javascript validation check
var num= /^[0-9]+$/;
do not work .
ziaht is offline   Reply With Quote
Old 10-07-2011, 12:54 AM   #2
cashloan
Registered User
 
Join Date: Sep 2011
Posts: 112
Default

Sorry i dont have any idea about it.
cashloan is offline   Reply With Quote
Old 11-25-2011, 12:53 AM   #3
ExpertsGuide
Registered User
 
Join Date: Nov 2011
Posts: 10
Default

Try checking for the presence of non-digit chars and then falsify it.
Code:
var isNonDigitPresent= /\D/g; 
if(isNonDigitPresent)
  alert('non digit present');
else
  alert('it is a number');
ExpertsGuide is offline   Reply With Quote
Old 01-12-2012, 04:05 AM   #4
ziaht
Member.
 
Join Date: Aug 2011
Posts: 59
Default

hey Experts guide

thnx for the reply

ur code is not working please help
ziaht is offline   Reply With Quote
Old 06-09-2012, 02:28 PM   #5
andrewlornxx
Registered User
 
Join Date: Jun 2012
Posts: 6
Default

please guys help
andrewlornxx is offline   Reply With Quote
Old 10-18-2012, 01:03 AM   #6
NickJohnson
Registered User
 
Join Date: Aug 2012
Posts: 22
Default

Try this...

function validateForm()
{
var x=document.forms["myForm"]["fname"].value;
if (x==null || x=="")
{
alert("First name must be filled out");
return false;
**
**
NickJohnson is offline   Reply With Quote
Old 10-19-2012, 09:45 PM   #7
Nullified
Registered User
 
Nullified's Avatar
 
Join Date: Sep 2012
Posts: 11
Arrow

Quote:
Originally Posted by NickJohnson View Post
Try this...

function validateForm()
{
var x=document.forms["myForm"]["fname"].value;
if (x==null || x=="")
{
alert("First name must be filled out");
return false;
**
**
WoW, are you retarded? Did you even read the thread author's question?
Quote:
Originally Posted by ziaht View Post
javascript validation check
var num= /^[0-9]+$/;
do not work .
You can check for numerical keystrokes:
Code:
jQuery(document).ready(function() {
	$("#id").keydown(function(event) {
var digits = [48,49,50,51,52,53,54,55,56,57,96,97,98,99,100,101,102,103,104,105];
var legalKeyCode = (!event.shiftKey) && (jQuery.inArray(event.keyCode, digits) >= 0);
if (legalKeyCode === false) {return false;**
	**);
**);
Or you can try regex:
Code:
// Expression: /^[0-9]+$/
// Replace function:
.replace(/^[0-9]+$/,"")

Last edited by Nullified; 10-19-2012 at 09:47 PM.
Nullified is offline   Reply With Quote
Old 10-23-2012, 01:00 AM   #8
NickJohnson
Registered User
 
Join Date: Aug 2012
Posts: 22
Default

Quote:
Originally Posted by Nullified View Post
WoW, are you retarded? Did you even read the thread author's question?
You can check for numerical keystrokes:
Code:
jQuery(document).ready(function() {
	$("#id").keydown(function(event) {
var digits = [48,49,50,51,52,53,54,55,56,57,96,97,98,99,100,101,102,103,104,105];
var legalKeyCode = (!event.shiftKey) && (jQuery.inArray(event.keyCode, digits) >= 0);
if (legalKeyCode === false) {return false;**
	**);
**);
Or you can try regex:
Code:
// Expression: /^[0-9]+$/
// Replace function:
.replace(/^[0-9]+$/,"")
My apologies. By mistake I put that program on this post. It was for different post. Didn't realise that m putting in a different post.
NickJohnson is offline   Reply With Quote
Old 10-28-2012, 03:09 PM   #9
Nullified
Registered User
 
Nullified's Avatar
 
Join Date: Sep 2012
Posts: 11
Default

Quote:
Originally Posted by NickJohnson View Post
My apologies. By mistake I put that program on this post. It was for different post. Didn't realise that m putting in a different post.
Honestly, I didn't expect you to respond. I thought you were a bot or something, thus I apologize for calling you retarded. We all make mistakes. Anyways the thread author never thanked us anyways so ehh.
Nullified is offline   Reply With Quote
Old 04-23-2013, 05:11 AM   #10
dagnyjbarber
Registered User
 
dagnyjbarber's Avatar
 
Join Date: Jan 2013
Location: India
Posts: 2
Default

why don't you try w3school
dagnyjbarber is offline   Reply With Quote
Old 04-25-2013, 07:41 AM   #11
Nullified
Registered User
 
Nullified's Avatar
 
Join Date: Sep 2012
Posts: 11
Default

ziaht, you're welcome by the way.
Nullified is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MIA June CJ Check washjob Making Money with CPC and/or CPM Programs 2 08-19-2001 02:19 AM
unidentified flying check coolshop Making Money with CPC and/or CPM Programs 7 06-07-2001 11:56 PM
search traffic check Kathy Making Money with CPC and/or CPM Programs 23 01-12-2001 05:41 AM
Anyone get their amazon check? Kathy Making Money with CPC and/or CPM Programs 12 11-15-2000 07:15 AM
-->How to change the check into money?-->urgent CYBERWORLD Making Money with CPC and/or CPM Programs 14 08-29-1999 11:03 PM

Please support our advertisers. They ensure our survival.

All times are GMT -5. The time now is 09:41 PM.


GeekVillage.com is copyright © 1998-2013 iOnline Pty Ltd. All rights reserved.
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.