Im looking for an easy method to validate the input of a form. Ideally I want to remove all spaces from the inputed text and also ensure that there are no speical characters within it other then a forward slash.

The input will look like this


Recommended Answers

All 3 Replies


Strictly speaking, that's not validation (testing); it's sanitisation (modification).

Both validation and sanitisation can be performed with regular expressions as @stb says.

fast fix


might do the trick...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.