These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

difficulties with javascript

fred7970
Registered: Aug 9 2007
Posts: 2

I've just installed acrobat 8.1
I want to work with forms and database connection (sql server).

Connection is ok, SQL request is ok.

my scrip is
[color=#FF0000]
try {
connect = ADBC.newConnection("liaisonODBC");
if (connect == null) throw "Impossible de se connecter";
statement = connect.newStatement();
if (statement == null) throw "Impossible objet statement";
} catch(e) {
app.alert(e);
}

statement.execute('SELECT pa_nom as nom FROM "my database"WHERE PA_ID=11')
statement.nextRow();

var row = statement.getRow();
this.getField("nom")= row.nom.value;
[/color]

the message in the console is :
this.getField is not a function
24:XFA:topmostSubform[0]:Page1[0]:nom[0]:click

I dont understand why ?

on my computer there is not global.js or config.js files is it normal ?

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
Since JavaScript is an object orientated language and "getField()" is a method of the field object, you will have specify the propterty of the field object you are trying to set. Otherwise JavaScript thinks you are calling a function.

this.getField("nom").value = row.nom.value;

George Kaiser