The PHP Group PHP
Problem for The PHP Group PHP

Integrating JavaScript within PHP....




By JMan82 on Oct 03, 2008

" "
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


Solution #1

posted on Oct 05, 2008
Not Rated)

cybiko123

Rank: Master 
Rating: 92%, 4 votes
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.)
Was this helpful?
Yes
No

Popular Solutions for The PHP Group PHP


Questions and Unsolved Problems for The PHP Group PHP


Do you recommend The PHP Group PHP?
Answer

Answer
I want to execute java command for a software which is stored on my web server with the help of... (More)

Answer
subject avaluation system php w/ mysql codes how to evaluate subject using php w/ mysql

Answer
Hi there, I am using PHP5, where i need to mail with attachement. exact thing is, am getting the... (More)

Answer
Hiya Im trying to get a collaspable panel to save state, the example I am currently using is... (More)


Didn't find what you were looking for?

Describe your problem:

Select a Category:







Ask our Experts

 

Solve Your Problem Now!
Chat Live with an Expert
Chat Now
Top Programming Tools Experts



Top Computer & Laptop Repairmen

(952) 890-7770
Zkarlo.com provides discount and used laptop parts...
Zkarlo.com

(513) 874-3306
We fix and repair laptop motherboard no video, no...
LaptopOnCall Inc.


       
Solve Your Problem Now!
Chat Live with an Expert
Chat Now

Insert Link
Insert Image
Insert You-Tube clip
Insert List
Insert List
Spell Check

What is this?



Select