Validate FreeTextField

Moderator: crythias

Post Reply
cbravo
Znuny advanced
Posts: 113
Joined: 18 Nov 2010, 00:33
Znuny Version: 3.0

Validate FreeTextField

Post by cbravo »

Hello guys,

What I would like to do now is validate the value a user has written in a FreeTextField. For instance, I want to check the serial number written against a list I have. I don't mind if the solution is javascript only at the moment. I would appreciate any help you guys could give me. it could be like the user can't leave the field until the correct number is written down.

Appreciate any guidance you could give me.

Greetings,

C.
OTRS: 3.08
OS: Ubuntu
Apache2/MySQL 5
artjoms15
Znuny advanced
Posts: 121
Joined: 30 Aug 2011, 10:48
Znuny Version: 3.3.8 && 4.0.9
Real Name: Artjoms Petrovs
Location: Latvia

Re: Validate FreeTextField

Post by artjoms15 »

Excuse me, but why don't you use a dropdown list then? If you have to validate it against the list. It would be the best option
One more way is to use JQUERY autocomplete, which goes over the dropdown and allows to enter some text.

Well, what I want to say - use a dropdown, to keep the list values and some client-side coding for representation and validation ;)
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Validate FreeTextField

Post by crythias »

(Here I am composing this long message and .. Yeah, artjoms15 is right until the list becomes 1,000 items)

jquery.validate.js is already distributed in
otrs/var/httpd/htdocs/js/thirdparty/jquery-validate-1.9
documentation for this is at http://docs.jquery.com/Plugins/Validation

Every implementation is different, and I'm *not* a jquery expert.

You may wish to get a hint on how OTRS is already validating using Core.Form.Validate. (This may be a red herring since you're wanting to check versus your list.).
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Post Reply