View Full Version : How to prevent spaces within text?
Nathon Jones
02-11-2010, 03:17 PM
I am trying to validate a form field that requests a username. I don't want the user to enter any spaces but I can't find anything in Validation Toolkit that checks for spaces within text, like in a name for example "Joe Bloggs".
Am I missing something? I've tried adding a space to the Restrict Content validation but this doesn't prevent entry of a name with a space in it.
Here's a link to a page where this is occuring:
http://www.moviegossip.co.uk/movie-register.asp
I'd appreciate any advice. Thanks.
Regards
Nathon.
Eric Mittman
02-12-2010, 04:49 PM
I did some testing with this but it was in php. What I found was that the space character was not matching the list of not allowed in the function call.
In php I could get it to work by making the not allowed value , I then had to add a string replace function around the value to replace any space with . When I did this it would pick up the space properly and show the error message when it was present.
There should be an equivalent thing you can do in the asp code. Please post back with a copy of the page that has the validation applied to it along with your WA_ValidationToolkit folder in a zip archive. I will take a look to see if I can get it working this way for you.
Nathon Jones
04-12-2010, 03:02 PM
Hi Eric,
Sorry, here is the zip file with the relevant files. I'd appreciate any advice you could offer, thank you.
Regards
Nath.
Eric Mittman
04-13-2010, 12:40 PM
I have opened a ticket for you on this issue. To check the status of your ticket or update it login and visit your support history.
http://www.webassist.com/mywebassist/supporthistory.php
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.