Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox character validation
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00212395
Message ID:
00212490
Views:
21
I don't know your situation, but I have a similar situation. I initially didn't allow the user to enter single quotes. I then found that it was a lot more likely that they would want to enter single quotes than double quotes. This might be true for your situation also. If it is, I would disallow double quotes and allow single quotes, and change your code appropriately.

Also, depending on your search algorithm, it might not be a good idea to invisibly (ie. unknown to the user) remove quotes. For example, if a user enters

Dan's

to find

Dan's Fish Barn

and you chop Dan's to Dans, your search function might not return Dan's Fish Barn and it should.

Take care,
Joe


>I have a search form that allows my users to search for record by entering in their search criteria in one to six textboxes, but the way I build my select statment based on their criteria does not allow for single quotes to be used as searching criteria (my select will bomb). I have many other controls on this form, as well as a grid to display the resultant data from their search, and an ActiveBar toolbar. When the user executes the request, I want to scan each textbox looking for a single quote, and if one or more is found in any of these texboxes, display a nice message asking them to kindly remove the single quote and try again.
>
>Another approach might be to just not allow a single quote in the textbox in the first place by trapping with keypress event...hmmm
>
>First, what is the best practice in dealing with this? Should I allow the single quote and then display the message, or should I just not allow it in the first place? Is there a standardized way of dealing with this type of entry validation?
>
>IF I end up allowing a single quote, what would be the "best method" of scanning the six textfields values for the illegal single quote?
>
>Any thoughts greatly appreciated!
>
>Thanks.
>
>John.
Joseph C. Kempel
Systems Analyst/Programmer
JNC
Previous
Reply
Map
View

Click here to load this message in the networking platform