Hey guys, am learning php/mysql and am trying to learn how to do the following. I have a database, and a form with 3 fields. I want fields 2 and 3 to be filled with data from mysql table immeadiately after field 1 receives a value. I think I am supposed to use the onfocus event on the 2nd field, and then add a query. I have tried different stuff but am not doing it right. Anyone have any examples of how to do this? I'd appreciate the help.
The form is below.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>main page...</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<form name="form1" action="">
Student Id: <input type="text" name="adm_no" id="adm_no" value="" />
<br />
Student Name: <input name="surname" type="text" id="surname" />
<br />
Class: <input type="text" name="class" id="class" value="" />
<br />
</form>
</body>
</html>