No announcement yet.

Field Validation

  • Filter
  • Time
  • Show
Clear All
new posts

  • Field Validation

    What is the best way to do a field validation and stop the event if the validation fails?

    Example, if I have a drop down field in a FORM, how can I make sure the user will choose one of the selected value and not leave an empty string to be saved to the database? (I know I can have a preset value but let's say I am not allowed to do that for some reason.)

    if (empty({Field}))
    sc_alert("Field cannot be empty");
    ???????? <--------------------------- Here is where I got lost. I want the event to stop and not to execute the Insert or Update even!

    I want it to go back to the original step while I was still entering data to the form.

    Thanks in advance!


  • #2
    If you are in the onvalidateevent you have code snippets on the right. Check your data for space and if so generate an errormessage and leave. The codesnippet is on the right.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development /


    • #3
      Thanks Albert