Announcement

Collapse
No announcement yet.

onvalidate event not fired ON control application

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

  • onvalidate event not fired ON control application

    I have a control application with some fields. Ofcourse the control app has two buttons, 'ok' & 'exit'.
    I presume that when i press the 'ok' button, the onvalidate event is fired.
    The first time i pressed it, it worked. The code is run. Now when i run it, it doesnt work. i have inserted sc_alert() messages to show code execution but nothing happens.
    Any ideas?
    here is the code:

    ------------------------------------------------------------------------------------------------------------------------------------------

    sc_alert("about to .....");

    $DateFrom = {DateFrom};
    $DateTo = {DateTo};
    $ClassID = {ClassID};
    $To = {To};
    $From = {From};

    sc_alert($DateFrom.$DateTo.$To.$From );

    // sql statement to retrive data from students
    $check_sql = "SELECT
    StudentsID"
    . " FROM Students"
    . " WHERE StudentsID >= " . {From}
    . " AND StudentsID <= " .{To};

    // execute the sql
    sc_lookup(rs, $check_sql);


    if (!empty({rs})) // some resutles where returned
    {
    $datasetCount = count({rs}); // returns count of array items of any array
    sc_alert("Number of Results Returned: '".$datasetCount."");
    /*for($i=0; $i <$datasetCount; $i++) // looping through rows of the array
    {

    }
    */
    }
    else
    {
    sc_alert("No results where returned from the students stable!!");
    }

    -------------------------------------------------------------------------------------------------------------------------------

  • #2
    sc_alert is not validated for the onvalidate event, see manual. YOu can use php 'echo' statement to show your vars. If the code contains a php error then the script will stop and it appears that nothing happened. You can set all debug options on to find out if you see more.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Good morning for everybody.

      The sc_alert macro works normally in onValidate event, see the manual in link below:
      http://www.scriptcase.net/docs/en_us...acros#sc_alert

      I tested here and worked fine, see images:
      img01.png img02.png img03.png


      check if the $DateFrom, $DateTo, $To and $From variables have value.
      try change variable name with a name different of the field.


      --
      Best regard
      Netmake team

      Comment

      Working...
      X