1
0
-1

i have java script too call post or get API. but the api only work when submit joget. 

so if possible i want java script do first when click submit joget before do the store binder


for example javascript i have like this

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Place your JS or jQuery inside this braces, in a Custom HTML:

      <script>
      $(document).ready( function(){
        $('#assignmentComplete,#submit').click(function() {
           // Your JS code runs here on Submit
        });
      })
      </script>


      1. galvin

        still no value 

        this is my js:

          $(document).ready( function(){
          $('#assignmentComplete,#submit').click(function() {
             
              $.ajax({
                                url: 'url_api',
                                type: 'GET',
                                contentType: false,
                                processData: false,
                                success: function(response) {
                                    console.log('GET Success:', response);
                                    FormUtil.getField("nama_bank_debitur_pegawai").val(response.customer_name);
                                    FormUtil.getField("norek_debitur_pegawai").val(response.rek);
                                },
                                error: function (xhr, status, error) {
                                    console.error('GET Error:', error);
                                }
                            });
             
             
          });
        });

        me using section option jdbc binder 



      CommentAdd your comment...