The PHP Group PHP Logo

Related Topics:

Posted on Oct 03, 2008

Integrating JavaScript within PHP....

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

1 Answer

Anonymous

Level 1:

An expert who has achieved level 1.

Corporal:

An expert that hasĀ over 10 points.

Problem Solver:

An expert who has answered 5 questions.

  • Contributor 13 Answers
  • Posted on Oct 05, 2008
Anonymous
Contributor
Level 1:

An expert who has achieved level 1.

Corporal:

An expert that hasĀ over 10 points.

Problem Solver:

An expert who has answered 5 questions.

Joined: Oct 05, 2008
Answers
13
Questions
5
Helped
2775
Points
19

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.)

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

705 views

Ask a Question

Usually answered in minutes!

Top The PHP Group Computers & Internet Experts

Rob Hill
Rob Hill

Level 3 Expert

1483 Answers

Nikole Brown
Nikole Brown

Level 2 Expert

124 Answers

Syed Bilal
Syed Bilal

Level 3 Expert

252 Answers

Are you a The PHP Group Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...