UK when not empty

hi,

is there a way to realise this:

"
{field} is an unique key when not empty
"

–> i have some fields in my form i would like to be an unique key. but also, these fields are not required. p.e. the field {webpage} which isnt a must-have in the form - not every member has one - but if it is, it should be not the same as someone else has.
i realised this within the ajax-onchange-event. opening the database, checking for the record and warning if i found something. isnt there an easyer way?

thanx :slight_smile:

The ajax method is the most responsive solution. I would do it the same way. But it’s not the most relyable solution because under some circumstances the ajax event is not triggered. So you need to repeat the code in the onvalidate which is a server side script and always be triggered.

thank you very much! and well - i hoped it could be easier.

…which i did :slight_smile: just didnt told here, because… well - i dont know why. i thought about an alternative, not about my old way g but thank you again for the hint!

You can consider putting the check into the libraries and call that from your events. You don’t have to replicate code and the eventcode will be pretty short, just call the function.

thank you again :slight_smile:

in this case i must say that calling a libarie function in SC never worked for me. i dont know what i do wrong there - but some weeks ago after trying for some hours i stopped working with this sc-functionality.

That’s a pitty. I’m working quite intensively with the library so I wonder what went wrong. You can also use php method for that, if it’s in the same application.