JQuery :: Validate At Least One Phone Number & Numbers Themselves?

Feb 11, 2010

have a form with three fields for home phone, work phone & mobile phone.I've got jquery to validate that the numbers entered are the right format, i.e. using the following with custom methods for the phoneUK etc.The thing is I only need one of these numbers. I have been trying *all day* to try and get this to work but no joy. I know I need to group them somehow but can't figure it out.I want it so I get a single message if all fields are left empty and then if a field does have an entry then it's validated to ensure its a number.

View 1 Replies


ADVERTISEMENT

Phone Number Form - Error-check It So That Only Numbers Can Be Entered Into The Phone Number Input Field?

Sep 26, 2011

I am working on a Phone Number Form. The link of script: [url]

Questions:

(1)I wanted to know if code this script so that instead of the phone number appearing as: (123)456-7890

So that it appears as: (123) 456-7890 with a blank space after the ")"

(2)If that's simple, is there a way to error-check it so that only numbers can be entered into the phone number input field?

View 1 Replies View Related

Need Form To Validate Phone Number Only

Sep 6, 2011

This is what I have so far, it is a template I copied from my working E-mail validation. I'm assuming I have to make it so it's just an array of numbers but I really don't know Java too well.

Essentially I just want numbers only to be accepted into the phone field. code...

View 2 Replies View Related

Validate Phone Number Code Isn't Working

Oct 26, 2010

how to validate forms and the next topic I'm learning is the phone feature! My code isn't working and not sure why! I read other opinions and tried to follow some templates but again.. Nothing is working out for me..

[Code]...

View 22 Replies View Related

String For Phone Numbers?

Feb 23, 2011

How can I write a string in JavaScript that will accept any phone number.

View 11 Replies View Related

Regular Expression For US Phone Numbers?

Apr 30, 2009

Here is the form in question: spraytechDOTcom/download_form.asp I am so close to getting this to work the way that I want, but here is what I am having an issue with: I cannot seem to make it look for the 12 digits that are in the phone numbers that we are going to collect. Ex. 800-123-4567

It doesn't have require 12 characters if there is another way to get the number to validate looking like the example above. Here is my regular expression that I am struggling with:

var re = /[^d-]$/ It seems to block any letters, but it will accept only 1 number. I would really like it to make sure that the phone number is only entered like this: 800-123-4567.

I have looked for days trying to figure this out and have only gotten close.

View 7 Replies View Related

JQuery :: Add Min Length Of 9 Validation For Phone Number?

Nov 20, 2011

I want to add a min length of 9 validation for a phone number. Thats once spaces have been stripped out.[code]What do I need to add for the min length? (once spaces have been stripped out)??

View 1 Replies View Related

Hiding Email Addresses & Phone Numbers In Forum Application?

Jun 10, 2010

I tried searching for this but couldn't find anything that looked correct (Although, I might not have a clue what I'm actually looking at!) I have a fairly simple forum system running as part of my site as part of the member system memberkit. I would like the forum to be public - members can post to the forum, and the public can post to the forum by putting in a name and email address.....

but....I would like some simple code to either block out, xxxx out, or remove entirely email address and phone numbers from forum visitors that are not members. I'd really like to show a gray block over the phone or email address that says "please login to view this information"

Now as part fo the system, I do have IFEQ tags available to determine if the user is a member or not, so I've got somethnig to execute the code on, but I just don't know what the code needs to be.

I've seen this done on other forums before for links and such, I'm just not sure how to do it. I'm guessing it would need to read the whole post message and look for certain strings of characters, etc. [URL]...

View 5 Replies View Related

Check Phone-number

Mar 16, 2007

I want to check phone-nummers of 10 characters long en only 0-9
no - so far i have the following script:

function isTel(string) {
if (string.length == 10) {
return true;
}
else
return false;
}

The check on 10 characters is ok but how to check only 0-9???

View 16 Replies View Related

Parsing A Phone Number?

Nov 28, 2011

In the assignment, I'm asking the user to put in a 10 digit phone number (numbers only, no dashes or parenthesis), and the program spits out the phone number WITH the parenthesis and dashes like this: System.out.printf( "(%03d) %03d-%04d", part1, part2, part3);

HOW to parse the phone number. Here's what I've got so far.. Middle and end.

import java.util.*;
public class C1Phone {
public static void main(String [] args) {
Scanner in = new Scanner (System.in);

[Code]....

View 4 Replies View Related

Js Validation Of A Phone Number

Jan 26, 2004

i was doing this in php but then i decided to do it in js but i am not familiar at all with it. i am trying to validate a phone number. it is supposed to be in the format xxx-xxx-xxxx.

View 2 Replies View Related

Split Phone Number Input?

Aug 12, 2010

i see alot of forms where the phone number field is split into 3 boxes.

<form id="contactform" action="contact-submit.php" method="post">
<!-- form fields -->
<div class="form">[code].....

how do i add a phone number field in there that has 3 connected fields?

View 2 Replies View Related

Regular Expression For Phone Number?

Dec 10, 2010

I need from regular expression for phone number like this +35 888888 or +35 888-888.

View 4 Replies View Related

Text Field Validation For Phone Number?

Jun 25, 2011

I have a phone number field on my form that needs validation, but I'm not sure how to code this. I have the following function to validate a first name is entered and last name. The phone number field must match a 7 digit or 10 digit(with area code)phone number. I want to be able to include paranthese and/or hyphens for the valid phone number.

function checkForm1() {
if (document.forms[0].firstname.value.length == 0) {
alert("You must put in a first name");

[code]....

View 11 Replies View Related

Create Phone Number Form Script?

Nov 30, 2009

How do i create a phone number form box in javascript using no inner html . there must be at least one dash in it. code...

View 3 Replies View Related

Phone Number Validation In Existing Form?

Jun 20, 2011

Another newbie question here, I'm sure. I'm trying to modify an existing form with an existing validation scheme. I have to put in something so that the phone field that is entered actually contains numbers. There is no need for dashes, parens or any other divider, but we don't want to exclude them either.

I have gotten as far as this: [URL]..110620_1a.html (new isPhone function that doesn't break anything added at lines 119 - 127) When I try to add the call for the checking however, the entire checking scheme breaks, and the form just executes: [URL]...._110620_1.html (Added code is at lines 190-198)

View 2 Replies View Related

Phone Number Validation \ Check Whether It Exactly Contains ONLY 10 Digits?

Aug 18, 2011

I want to validate phone number in my project. I include some validations. Furthermore i want to check whether it exactly contains ONLY 10 digits.nothing more and nothing less.How should i include that?

if (document.form1.phone_number.value == '')
{
alert('Please fill in phone number!');

[code].....

View 7 Replies View Related

Validate The Phone Field \ Combine The Script With The Other Validation?

Jan 24, 2009

I have a form on my website and I want to validate the phone field. I found a good script to do it but I need to combine the script with the other validation that I have on my formadd this phone validation script into the other validations that I have so that it is just one javascript?Here is the phone validation script:

<script language = "Javascript">
/**
* DHTML phone number validation script. Courtesy of SmartWebby.com

[code].....

View 9 Replies View Related

Simple Email And Phone Number Validation From Form

May 17, 2009

I am in need of some very simple javascript to validate email address and a phone number from a form.
The email address only needs to:
1. Check that the box is not empty.
2. Check that the text imputted contains an '@' symbol.
3. Check that the text imputted contains atleast 1 Period.
The phone number only needs to:
1. Check that the box is not empty.
2. Check that there is no more than 11 characters.
3. check that only numeric characters have been inputted.
I would like it to report (failure) back as text on the page under the box that has the problem rather than a window.

View 4 Replies View Related

Error = "The Phone Number Is The Wrong Length?

Aug 1, 2010

I have forum validation script but this script cant validate the phone number field. My script:

if(document.getElementById('user_phone').value=='')
{
alert(Please, enter <?php _e(PHONE_TEXT) ?>');

[code].....

View 10 Replies View Related

Form Validation Check If Email Or Phone Number Entered?

Jul 24, 2009

I have this form validation code

function check_email(mailstring)
{
valid = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
for(i=0; i < mailstring.length ;i++)

[Code]....

at the moment its checks that someting has been enetered in all these fields,

what would be the best way to check that the email or phone nummber had been entered?? will not send if nothing enetered, but will send if one or both have been enetered?

View 4 Replies View Related

If Enter Any Invalid Characters, It Gives Error And Sends Back To The Phone Number Field?

Feb 8, 2010

I am working on a javascript code for validating phone numbers against 0's.The scenario is that, 1 ) If the phone number contains all 0's in it, an error message is displayed. Eg. 0, 0000, 000-000-0000, 000,0000000000 etc..2 ) Phone number should only take digits [0-9] and some delimiters ()-,.+ "All other alphabets and special characters are not allowed.Eg. 01, 102-125-0214, etc.. ( allowed ) sjjlkjkj, xllfs -09-49- ( not allowed )3 ) The code I have written is as below -

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

[code].....

View 3 Replies View Related

Validate Three Textboxes And It Will Validate For Numbers?

Feb 19, 2010

I need to validate three textboxes and it will validate for numbers. How should I change my code to validate three textboxes?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >

[code]....

I need to use Javascript to validate 3 textboxes, whereby the users can only key in numbers (because they are phone numbers related fields). If any of the textbox is empty, display an alert message to show which textbox is empty. I do not want to show many alert messages to show that, for example, text1 and text2 are empty, it will show two alert messages. I would need to show one "summarized" alert message instead.

View 15 Replies View Related

JQuery :: Validate A Text Input To Not Accept Numbers

Aug 7, 2009

I have searched the internet and couldn't find a problem regarding this issue. The thing I want to do is simply validate a text input so when you enter a number in it, it won't validate and give you an error message. This is the code:

[Code]...

View 1 Replies View Related

Validate Numbers In A Generic Way?

Apr 9, 2010

In my form, i have around 20 textbox. I want to validate all the textbox. It should accept numbers and decimals. I have the following code...

How can i make the call generic to all the textbox?

View 1 Replies View Related

Validate That Numbers Are Entered

Oct 30, 2001

I'm trying to make sure that when a user enters information into my textbox, that when the textbox loses focus then it checks to make sure that they entered numbers and not text or other characters. Numbers only....Any suggestions?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved