RegExp in a form field

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Calimero
Forum Contributor
Posts: 310
Joined: Thu Jan 22, 2004 6:54 pm
Location: Milky Way

RegExp in a form field

Post by Calimero »

Here back be me hi.

// Read the words backwards :)

My problem goes like this:

I have input in the text field, I succesfully removed some words on submit, but I have a problem if someone does this or this - puts lots of white spaces inside the input.


What is the code - pattern to match in the code below

var pattern = new RegExp("?????", gi);


The pattern should register if there are 2 or more "white" spaces together and replace them with only one white space.

The replacing I know, just the RegExp pattern.


Thanks Ahead !
User avatar
Calimero
Forum Contributor
Posts: 310
Joined: Thu Jan 22, 2004 6:54 pm
Location: Milky Way

...

Post by Calimero »

Anyone !?!?!?
Post Reply