Search code examples
jquerymysqlajaxintrexx

Posting data into MySQL without form tag


I'm using Intrexx Professional to build some forms for my company. These forms are not built with code.

However, they support JavaScript, JQuery and AJAX for extra functionality.

I was just wondering if you could provide information on how to save the form data into MySQL with jQuery and AJAX. I was looking at some tutorials, but they are all based on HTML forms. Thanks


Solution

  • Get values of inputs using jquery,

    var a = $('#id-of-a').val(); 
    var b = $('#id-of-b').val(); //and so on.
    

    instead of .serialize(). Or you can use an array for variables, and loop using .each() or other methods in jquery to get values.

    Post to php file and get response,

    $.post(
       "http://www.example.com/ajax.php",
       { a : a, b : b},  //variables.
       function(response){
            //process response
            console.log(response);
    });
    

    You may also use $.ajax() to post to php.