Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » creating an input mask for a field in a form (HTML)
Closed Thread
Old 10-09-2006, 08:21 AM   #1 (permalink)
 
Junior Techie

Join Date: Oct 2005

Posts: 72

chooka

Default creating an input mask for a field in a form (HTML)

Hi all. I am very new to web development and am trying to create my first website which contains a questionnaire.
What i want to do is create a input field in a form which prompts for a six 6 character password. I want the password to have the first character in the set [0,1,2,3,4,5,6,7,8,9], the next character to be an uppercase alphabetic, the next three characters to be alphanumeric and the final character to be an uppercase character.
I have read through a heap of posts and javascript/HTML books to find the answer but dont really know what would help me.
Thanx heaps guys.
__________________
Pentium Core 2 Quad Q6600 2.4Ghz
4Ghz 1066 RAM
2x 500G SATA II HDD
GIGABYTE GA-P35-DS4
GeForce 8800GTS 320MG
Themaltake Armor

_______________________

Diploma in IT Computer Networking
Bachelor of Computer Science
chooka is offline  
Old 10-09-2006, 06:22 PM   #2 (permalink)
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,410

office politics will become famous soon enough

Default

do you want it auto generated or do you want to validate the users input?

for auto gen:

create the password
set do***ent.formname.fieldname.value = password

for validate

add onsubmit="return validate()" attribute to your form
add javascript function
function validate {
check value here using do***ent.formname.fieldname.value
return true if valid
return false if invalid
}
office politics is offline  
Old 10-10-2006, 12:42 AM   #3 (permalink)
 
Junior Techie

Join Date: Oct 2005

Posts: 72

chooka

Default

hi thanx for that csamuels but is there a way using regular expression to do it??
__________________
Pentium Core 2 Quad Q6600 2.4Ghz
4Ghz 1066 RAM
2x 500G SATA II HDD
GIGABYTE GA-P35-DS4
GeForce 8800GTS 320MG
Themaltake Armor

_______________________

Diploma in IT Computer Networking
Bachelor of Computer Science
chooka is offline  
Old 10-10-2006, 04:28 PM   #4 (permalink)
 
Super Techie

Join Date: Sep 2005

Posts: 341

hillbillybob

Default

Sounds like you are wanting to validate user input. Why do you have to use Regular expressions?

Are you validating against a database? ie validating user login?
__________________
The greatest measure of a nation is not it\'s army or economy, but by how many people are trying to get in, and how many people are staying!!
Guns, Guts, and Alcohol made America free.
Born American, Die American
Ubuntu - it\'s all about the bun\'s baby!!!
hillbillybob is offline  
 
Closed Thread

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On