I’ve set a dataadapter to get a value from mysql database and need to pass that value to a variable used in another section of my script
dataadapter is like this
var source_form =
{
datatype: "json",
type: "POST",
datafields: [
{ name: 'AUTO_INCREMENT' }
],
url: url,
async: false,
data: {
select: true,
dbase: "information_schema.tables",
numrow: "1",
filtre: "table_name = 'formadmin' AND table_schema = DATABASE( )",
ordre: "-",
field: "AUTO_INCREMENT"
}
};
var dataAdapter3 = new $.jqx.dataAdapter(source_form, {
loadComplete: function (records) {
var records = dataAdapter3.records;
var record = records[0];
$(‘#formulaire’).html(“Formulaire no: ” + record.AUTO_INCREMENT);
var form_no = record.AUTO_INCREMENT;
},
});`
I get the value from my php script and can print it via
$('#formulaire').html("Formulaire no: " + record.AUTO_INCREMENT);
...
<div id="formulaire"></div>
but I cannot get the var form_no to be available in other part of my script like in grid so I can send it back to mysql with other info
How do I get the form_no value outside the dataadapter section