Announcement

Collapse
No announcement yet.

Event Ajax OnClick Image HTML

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

  • Event Ajax OnClick Image HTML

    Hi Guys, I want to check the following:

    1) I create an HTML Image type field.
    2) In this field we created a Ajax OnClick ejento
    3) In this event insert the following code

    / **
    * Insert a record on another table
    * /

    sc_ajax_message ("Message", "Title");

    {datetime_field} = date ('Y-m-d H: i: s ");
    / / SQL statement parameters
    $ insert_table = 'inscripcion_alumnos', / / ​​Table name
    $ insert_fields = array (/ / Field list, add as many as needed
    'Userid' => "1",
    'IdInscripcionEstado' => "1",
    'IdCtrCdCurso' => {IdCtrCdCurso}
    'FechaInscripcion' => {datetime_field}
    );

    / / Insert record
    $ insert_sql = 'INSERT INTO'. $ insert_table
    . '('. Implode (',', array_keys ($ insert_fields)). ')'
    . 'VALUES ('. Implode (',', array_values ​​($ insert_fields)). ')';

    sc_exec_sql ($ insert_sql);
    }


    When I click, it does absolutely nothing?, Any idea what happens?
    Thank you in advance to all ..
    Leandro Carames
    http://www.softnetbaires.com.ar

  • #2
    Not sure, but in the line:

    $ insert_table = 'inscripcion_alumnos', / / ​​Table name
    $ insert_fields = array (/ / Field list, add as many as needed

    is an error. Befor the double slashes needs to be a ; in stead of a ,
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      is possible, I will try, but also left only this line of code:

      sc_ajax_message ("Message", "Title");

      no other sentence and not the run
      Leandro Carames
      http://www.softnetbaires.com.ar

      Comment


      • #4
        Not working for me also, I have just one statement sc_alert("Hello");

        It does nothing for me when I click on custom button.

        Comment


        • #5
          If you need to display messages you need to be in the right scope of your application to do so. That's why the code snippets on the right side of you edit screen aren't green on all events. Besides that you need te be aware that if you use an ajax popup your application must still be alive to be able to do so. I mean, if you follow by a sc_redir of some kind (by using the macro of other ways of navigating) then the popup simply cannot show up. If you have a sc_alert which afaik translate to the javascript alert it's more-or-less the same issue. The alert needs to be triggered from your javascript/html page. But to be honest, I'm puzzled now and then why a message cannot be used when I need it. When needed for debugging I put my messages into a debug file. That always works.
          Albert Drent
          aducom software netherlands
          scriptcase partner, reseller, support and (turn-key) development
          www.scriptcase.eu / www.scriptcase.nl

          Comment

          Working...
          X