Jump to content

Action depending on drop down selection


gnawz

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.