Jump to content

Recommended Posts

Hi

 

Here is my code that calls an AJAX update function when an option is selected from <select> component:

 

<select name="publisher_id" style="width: 130px;">
    <option value="">Select Publisher</option>

        <?php

    foreach ( $publishers as $value ) {

        	?>
	<option value="<?php echo $value->ID; ?>" onClick="ShowProjects ('<?php echo $value->ID; ?>');"><?php echo $value->publisher_id; ?></option>
	<?php
    
            }

?>

</select>

 

The problem being the onClick is only working in FF ??? I tried adding onChange="ShowProjects(this.selectedIndex);"  as well but makes no difference

ah its the selectedIndex it doesnt work. If you look at my code again I dont want the ShowProjects function to take the selectedIndex I need it to take the $value->ID  ( as seen in the onClick on the options )

 

How would I accomplish this with the onChange ??? Or is there a way to allow onClick to work in ie?

That's odd that it doesn't work in IE.  Does the same call to ShowProjects() work if you call it elsewhere, such as in the body's onLoad() ?  Just to see if the compatibility issue is in how it's called, or in the function itself.

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.