Results 1 to 2 of 2

Thread: select option onClick browser problems!!!

  1. #1
    Join Date
    Oct 2008

    select option onClick browser problems!!!

    Hello people!
    I think I have a browser problem: I tried to make a drop-down menu, where something has to happen as soon as you select an option from this menu. In Firefox it works perfectly, but safari and IE7 don't get it.
    I wrote a little exampe to show what I mean:

    $Row = "1030";
    echo "<select><option value=\"$Row[2]\" onClick=\"Javascript:alert('Hello world');\">$Row[2]</option>
    <option value=\"$Row[1]\" onClick=\"Javascript:alert('Hello World');\">$Row[1]</option></select>";

    This script also works in Firefox, but not in the other browsers.
    Does anyone know why? And is there a solution for this?

    Thanks for the help, mulossie

  2. #2
    Join Date
    Dec 2005
    Put the onclick on the select element (or better yet, onchange). When you google this problem, it seems that this is commonly known for IE and Safari
    Last edited by aj_nsc; 10-16-2008 at 07:31 AM.
    I've switched careers...
    I'm NO LONGER a scientist,
    but now a web developer...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center