Announcement

Collapse
No announcement yet.

UK when not empty

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    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.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


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

      Originally posted by aducom View Post
      So you need to repeat the code in the onvalidate which is a server side script and always be triggered.
      ...which i did 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!

      Comment


      • #4
        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.
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment


        • #5
          thank you again

          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.

          Comment


          • #6
            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.
            Albert Drent
            aducom software netherlands
            scriptcase partner, reseller, support and (turn-key) development
            www.scriptcase.eu / www.scriptcase.nl

            Comment

            Working...
            X