When he selects from a pulldown menu in the "new" page the next field should be filled with a number.
Let me explain: When the user adds a new office in the program, the office_nr gets filled with a number (max + 1)
- Code: Select all
function KantoorID__default()
{
include("conf.php");
$con = mysql_connect($host, $user, $password);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($name, $con);
$sql = "SELECT MAX(KantoorID) AS Hoogste FROM D2D";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$terug = $row['Hoogste'] + 1;
mysql_close($con);
return $terug;
}
The above works for the adding of a new office but for a new client I need the value of a select box. (officeID + followNr example: 010001: office 01 client 0001)
When he adds a new client he must first select a office and regarding this office_ID the client_nr is calculated but how do I find the value he has selected in the pulldown before he has saved?
thanks in advance,
Polderboy