Jump to content

Recommended Posts

Hi Ive got the following drop down menu and I want to perform an action every time someone uses the dropdown. How Can I determine when it has been used? Normally I would pass in a mode but because its GET, I cant and if i change it to POST, it doesnt work how I want it to?

 

Thanks

 

<select name="iCat_Id" onchange="CatChange.submit()">
<option value="0">-- All Offers --</option>

<?php 
	//Get categories for this site
$rCategories = $oTblCategories->GetCategories();

while ($oCategories = mysql_fetch_object($rCategories))
	{?>
<option value="<?=$oCategories->category_id?>"<?=($iCatId == $oCategories->category_id)?' selected="selected"':''?>>
<?=$oCategories->category ?></option>

   <?php } ?>	
</select>
</form>

the "if" statement is the same as if the form were submitted using a submit button. All PHP gets is submitted data.

 

As the name of the drop-down is "iCat_Id" then

 

<?php
if($_GET['iCat_Id'] == 'something') {
       //Do something here

}
?>

Thanks for the reply, I already know that. My drop down works fine but its when I change pages I wanted to set the start to 0 when the category is changed. I have done it now however by passing in a hidden mode and then doing if($_GET['mode'] == changeFilter) {

$iStart = 0;

}

 

Thanks anyway for your help

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.