Setting Text Field Properties

Mechaworx

Registered User.
Local time
Today, 14:09
Joined
Jul 14, 2003
Messages
11
Hi All,

I have only been playing with MS Access for a little while and I do not know all there is to know yet so I figured I come here to ask a question.

I use MS Access in web design and lately I have been experiencing a problem with my registration form which inserts new users into an MS Access database table.

Lately my registration form has become a target for spammers trying to inject spam in the form of html code into the password field of the online registration form.

I figured that I could deter this from happening by only allowing the letters A - Z and numbers 0 - 9 in the field and not allowing characters like < > and ? and ".

I assume I can do this with a validation rule but I'm unsure as to how I would go about setting this up. Limiting the field size to only 50 characters does not seem to work unfortunately.

Any help on how to set up a validation rule would be appreciated.

Thanks
Mechaworx
 
is there a before update event for the field.

test the string in there. test each char at a time. I saw a thread within the last month to do this

sorry, i had a look for it, but i can't find it now.
 
Hi Gemma

That's probably what I want to happen, ie; before the data is entered, check the characters in the password field then if it contains html characters don't insert into the database.

It's just writing the expression in the validation rule that I'm having a hard time with as I have not written one at all.

Mechaworx.
 
you won't be able to do it with a validation rule. i'm not 100% sure how web pages work properly, but controls (eg textboxes) on normal access froms have various events.

one event is the beforeupdate evenyt (ie happens before you accept the input data
another is the afterupdate event (happend AFTER you have accpeted the data - maybe you then need to check other things etc).

So if you need to validate input in a way that a validation rule can't do, you should do it in the BEFOREUPDATE event, and then decide to reject the input.

but to do this you need code, and as i say, there is definitely a posting here that deals with the rejection of particular characters (within the last month) although I was unable to find it earlier.
 

Users who are viewing this thread

Back
Top Bottom