Posted by GarryJones on 09/28/07 19:01
Thanks for your help.
I am a bit lost with your answer as "ctype_digit" is new to me, but I
will look into it. When I set this up last year I was not aware of the
complications of not validating. Users keyed in data in many different
ways. So now I have an enormous database with thousands of user
inputted data that I still need.
This is a control system for cycling events in Sweden and now I need
to set it up for 2008's applicants. In doing this I need to check
values users have already keyed in.
This because my form will propose new values based on last years
input. However as I can not (for instance) add one to "ca 100" in
those cases I will not open the new form for input, they will be
returned to the old form to key in correctly.
When collecting data for 2008 I am now (a little) more experienced and
can validate to skip future problems.
What I would really like is access type input validation where no
other key can be pressed when user is in the "number only fields".
So basically I am looking at two problems.
1) Last years data to be recycled if numeric,
2) Validation now needed in number only fields.
As for problem 1 let me explain.
Each organiser has to have declared how many cyclists they had in this
years events to be able to enter the details of their event for next
year.
The number 15 303 IS valid as they have keyed in an exact number. The
value "ca 100" or "ca100" is not valid as I need exact numbers.
So I need to validate the data that is already in the mysql database
(possibly with a function?). I felt I was very close with the function
I was using if I can just get it not to test (or ignore) the space
between 15 and 303?
Of course another way of going about this is mysql code to alter
necessary and invalid values in database and I may go down that road
if I can't solve it with php.
Sorry about the long winded answer/question.
Any feedback very much appreciated.
Garry Jones
Sweden
[Back to original message]
|