/    Sign up×
Community /Pin to ProfileBookmark

Field Validation ASP.net

I’ve got an issue with some form validation I was hoping to toss by you guys.

I need to validate phone number box 2/3 in in my form, RequiredFieldValidator makes it look messy so I want to write a JavaScript to handle it. Most examples I found do popup messages and that isn’t what I want in my form. This is a multiple page application so I need an idea that is clean and effective just at warning not stopping the application.

I wrote one for a server/client side validation with customervalidator but my client didn’t like the post back.

So any one have suggestions?

This was my old phone validation.

[CODE]
function PhoValidation (source, args)
{
var PHO1 = document.getElementById(“pho1”).value;
var PHO2 = document.getElementById(“pho2”).value;
var PHO3 = document.getElementById(“pho3”).value;

if ((PHO1.length == 3) || (PHO2.length == 3) || (PHO3.length == 4))
args.IsValid = true;
else
args.IsValid = false;

}[/CODE]

Thank you

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @Stium spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...