This is basically what the name says. I have a form with the selected control that I want to make the form send back to itself when it changes.
$bmsclientlist = $clientobj->getBMSClientList(); echo '<form name="changebmsid" method="post" action="' . $_SERVER['PHP_SELF'] . '"><select name="bmsid">'; foreach($bmsclientlist as $bmsclient) { $var = ''; if($client['bmsid'] == $bmsclient['id']) { $var = ' selected="selected"'; } echo '<option value="' . $bmsclient['id'] .'"'. $var .'>' .$bmsclient['clientname'] . '</option>'; } echo '</select></form>'; $backupobj = new AdminBackup(); if(isset($_POST['bmsid']){ $statusarray = $backupobj->getStatusTotalsbyId($_POST['bmsid']); }else{ $statusarray = $backupobj->getStatusTotals(); }
I know this will attract some javascript, but I'm not too sure how to achieve this.
Any help is most appreciated!
Thanks,
Jonesi
javascript php forms postback
iamjonesy
source share