Gossamer Forum
Home : Products : DBMan : Installation :

Validating Feilds on Submittion

Quote Reply
Validating Feilds on Submittion
In the config file, I set a feild to be 3 numerical digits long. When I go to submitt a record to test it out, I realized the script is taking any three characters, no matter if its alpha or numerical. How would I get it so the script to validate a feild for 3 numerical digits and produce an error if anything else (alpha) is typed in? Tanks for any help..
Quote Reply
Re: Validating Feilds on Submittion In reply to
Change the maxlength column to 3 as well, not only the minimum column to 3. Set both columns in the fields to be 3.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------









Quote Reply
Re: Validating Feilds on Submittion In reply to
Yes, I understand. In the config file, the feild I am trying to get to validate for 3 numerical numbers looks like this:

Course_One => [3, 'numer', 3, 3, 1, '', ''],

But still, the form allows me to enter anything, alpha or numbers, less than 3 characters, it is accepting any input. How can I change it to accept only 3 numerical digits?
Quote Reply
Re: Validating Feilds on Submittion In reply to
Well, it shouldn't. Check the HTML codes in the sub html_record_form.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------









Quote Reply
Re: Validating Feilds on Submittion In reply to
I am currently using auto generated forms and have not edited sub html_record_form. Could this be the problem?
Quote Reply
Re: Validating Feilds on Submittion In reply to
Not really...auto generation should read the maxlength column when building forms...but try turning off auto generation and then create your own forms in the sub html_record_form, and see if the problem persists.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------









Quote Reply
Re: Validating Feilds on Submittion In reply to
I believe what zns is looking for is something to add as a valid expression which would only accept numeric characters.

I'm not a programmer so don't have the answer but it must be similiar to how you would define:

email format: .+\@.+\..+
date format: DatePosted => [1,'date',12,15,1,&get_date, \d{2}\/\d{3}\/\d{4}''],

Hope this will at least help you to search for a solution by knowing you can do this in the .cfg field definition using a valid expression.

Or would it simply work by defining the field as numeric?