gnawz Posted July 24, 2007 Share Posted July 24, 2007 these are my files reports.php $Report = $_GET['report']; switch ($Report) { case 'add' : addfunction(); break; case 'delete' : deletefunction(); break; case 'update' : updatefunction(); break; } the other file with my select... checkrpt.php <form name="frmUtils" method="post" action=""> <select name="Do" id ="Do"onChange="SwapReport();"> <option value="0">Select view</option> <option value="1">Add</option> <option value="2">Update</option> <option value="2">Delete</option> </select> </form> <script type="text/javascript"> function SwapReport() { if (document.frmUtils.Do.selectedIndex == 1) { document.frmUtils.action = "reports.php?report=add"; } else if (document.frmUtils.Do.selectedIndex == 2) { document.frmUtils.action = "reports.php?report=update"; } else (document.frmUtils.Do.selectedIndex == 3) { document.frmUtils.action = "reports.php?report=delete"; } } </script> Help from here. It is not working yet. Link to comment https://forums.phpfreaks.com/topic/61518-action-depending-on-drop-down-selection/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.