HOW CAN I: validate more than one field with one method

I want to validate email adresses on more than one field in more than one form…

Can I do something like that with just one method? By using the new ‘getMethodTriggerElementName’ function or is there another, easier’ way?

Thanks for your answers in advance…

Passing the field as argument to global method.
assume you have a global method called “validate”
if you call validate(my_database_field) the field content is passed

al you have todo in the global validate method is this
var fieldContent = arguments[0]
//do what ever check you want todo

Oh *&^&$&% this was again too obvious to think of myself :oops:

Thanks Jan…

Jan,

Jan, to follow up on this let’s go one step further.

I now have that global routine and I am very happy with it!!!

I now call a form method from the field on the onDataChange event. That method then calls the validation global method. This saves me changing the same method over and over.

So, I still use two methods. Or is there another way?

Would it be possible to call the routine including the content of the field (or selection with a combobox etc.) from within the property window of the field (in the near future). This would save a lot of typing at saves a lot of ‘clutter’ of all those ‘almost empty’ methods…

Curious what you think of that!