Hello,
I am new to Chronoforms, so as Javascript.
I am building a form to update student information. The form has student_id, name and several other fields (all text fields).
I want to be able to input student id and get the name from the student table and other fields from the project table.
I drag the Load JS action to the OnLoad event and added a 'blur' event to the student_id field using Javascript.
In Load JS action of OnLoad event:
I want to somehow get the record from the database when the 'blur' event of student_id if fired and the student_id is not empty (after student_id is input and lose focus).
The student_id 'blur' event is working, but where should I put the PHP code to get data from the database (in the same LoadJS action?) and how do I call it from the student_id 'blur' event function?
Thank you.
I am new to Chronoforms, so as Javascript.
I am building a form to update student information. The form has student_id, name and several other fields (all text fields).
I want to be able to input student id and get the name from the student table and other fields from the project table.
I drag the Load JS action to the OnLoad event and added a 'blur' event to the student_id field using Javascript.
In Load JS action of OnLoad event:
window.addEvent('domready', function() {
$('student_id').addEvent('blur', function() {
var id = $('student_id').value;
id = id.trim();
if (id.length <= 0)
alert("here ");
else {
// Student id is not empty here, want to retrieve record from database, but how?
alert(id);
}
});
});
I want to somehow get the record from the database when the 'blur' event of student_id if fired and the student_id is not empty (after student_id is input and lose focus).
The student_id 'blur' event is working, but where should I put the PHP code to get data from the database (in the same LoadJS action?) and how do I call it from the student_id 'blur' event function?
Thank you.