I was wondering how to enable and disable form buttons, depending on which button I select, with JavaScript within PHP?
I have 5 buttons: "New Conference Leader', Save Conference Leader", Unlock Conference Leader", "Update Conference Leader", and "Delete Conference Leader". Update and Save buttons are disabled when the page loads.
So for example if I select "New Conference Leader" button, all buttons including "New Conference Leader" should be disabled, except for "Save Conference Leader", which should be then enabled.
All the help will be helpful:). I have had an error on the page when I run the PHP script saying that it was successful but with errors or something.
Thanks,
JMan82
If you're trying to do this with PHP, you might be more successful creating an initial page with the buttons that should be enabled at the start (New, Update, Delete), and then create a sub-page that displays a different form depending on the action the user selected previously. This way, the user only sees the buttons relevant to his/her current action. Here's some beginning code to help you out:
<?php
$action = $_POST['action'];
if($action == 'new')
{
//display the form for creating a new conference leader
}
else if ($action == '$update')
{
//display the form for updating a conference leader
}
et cetera.
Each sub-form would be processed by a third-level page (e.g. handle_create.php, handle_delete.php, etc.)
705 views
Usually answered in minutes!
×