Before writing the function get_mysql_values()
I made the following test :
- I wrote your code slightly modified into "mysql.js" file
located into the "script" directory of bureaucracy.
- I add a line into the script.js file located into the bureaucracy directory (just to include mysql.js)
- For test only, your code was modified by replacing mysql_value[1] by a constant string "hello" (see below)
jQuery( document ).ready(function() {
/*var mysql_value = get_mysql_values(); */
var i = jQuery("[name='bureaucracy[1]']");
i.get(0).value = /*mysql_value[1];*/ "hello";
});
function get_mysql_values() {
/* either JSINFO or get using Ajax */
return values_array;
}
Then without doing anything else
I found "hello" into the fist field of my form.
Then I replaced "hello" with another word
but nothing change : "hello" remains always.
I tried to change another field thinking
that I have to replace i.get(0) with i.get(n) for field n
but without effect.
Sorry for asking so basic questions
but it not obvious for me.