LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-13-2005, 02:50 PM   #1
javier_ccs
Member
 
Registered: Apr 2005
Location: Milton Keynes
Distribution: ubuntu 12.10
Posts: 90

Rep: Reputation: 15
Question validating....


hello guys,

im a newbie and i would like to know how can i validate a form to accept only 4 numerical characters....

thanx for any help given....
 
Old 06-13-2005, 03:25 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
It depends which language you use. Form itself (properties) can be set to accept max 4 characters in a field (depending on the filed type). The validation part (checking if it's numerical or not) must be done later, with Java Script, PHP or any other language.
 
Old 06-13-2005, 03:28 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
would kinda help if you told us anythign at all about what languages your'e using...
 
Old 06-14-2005, 08:00 AM   #4
javier_ccs
Member
 
Registered: Apr 2005
Location: Milton Keynes
Distribution: ubuntu 12.10
Posts: 90

Original Poster
Rep: Reputation: 15
thanx all for responding.....

im using php 4 and java script.

i just want that the input field show like a "warning" when an user tries to post the form having entered a number with less than 4 digits (123) in an input field....

i know that it can be validate with java....but i can't seem to find a good ol' example...

can u help me???
 
Old 06-15-2005, 03:07 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
there's so much stuff on google... for example http://www.javascriptkit.com/javatutors/form7.shtml
 
Old 06-15-2005, 08:22 AM   #6
javier_ccs
Member
 
Registered: Apr 2005
Location: Milton Keynes
Distribution: ubuntu 12.10
Posts: 90

Original Poster
Rep: Reputation: 15
thank you, i'll check it out...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script, validating email and website Joey^s Programming 5 12-04-2004 05:31 PM
Validating user name/password kuna Programming 1 12-02-2004 10:39 PM
Validating rules file error. mike8994 Linux - Networking 0 09-05-2004 08:45 AM
validating user input blanks Programming 3 09-02-2004 03:47 PM
validating a surname - regexp fu chr15t0 Programming 2 06-20-2003 05:55 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration