- Tue Mar 28, 2017 12:01 pm
#789986
I have three fields on a Dyanform, I am expecting that when a user input a valid Passport Number, the First Name and Last Name from the database will be retrieved and populated.
FirstName
LastName
PassportNumber
There is a database table "CUSTOMER" (not PMTable but sits on the same MySQL database) created with the fields above
A database connection is created to the database and on the Dynaform, I have put the following SQL on the FIrstName and LastName fields correspondingly
SELECT FIRSTNAME FROM CUSTOMER WHERE PASSPORTNUMBER = @@PassportNumber
And
SELECT LASTNAME FROM CUSTOMER WHERE PASSPORTNUMBER = @@PassportNumber
There is no errors but I could not get the First Name and Last Name fields refreshed even when I update Passport Number on the form.
I tried to create a button with the follow script but it does not work neither. Can someone help please?
$db = "46351562218d923e118a881289223496";
$("#customerLookupButton").find("button").click(function(){
$idDocRef = jQuery("#PassportNumber").getValue();
var dummy = getFieldById("FirstName").executeQuery();
});
FirstName
LastName
PassportNumber
There is a database table "CUSTOMER" (not PMTable but sits on the same MySQL database) created with the fields above
A database connection is created to the database and on the Dynaform, I have put the following SQL on the FIrstName and LastName fields correspondingly
SELECT FIRSTNAME FROM CUSTOMER WHERE PASSPORTNUMBER = @@PassportNumber
And
SELECT LASTNAME FROM CUSTOMER WHERE PASSPORTNUMBER = @@PassportNumber
There is no errors but I could not get the First Name and Last Name fields refreshed even when I update Passport Number on the form.
I tried to create a button with the follow script but it does not work neither. Can someone help please?
$db = "46351562218d923e118a881289223496";
$("#customerLookupButton").find("button").click(function(){
$idDocRef = jQuery("#PassportNumber").getValue();
var dummy = getFieldById("FirstName").executeQuery();
});