'onclick' problem

Discussion in 'HTML' started by Mel Smith, Sep 15, 2010.

  1. Mel Smith

    Mel Smith Guest

    Hi:

    The 'onclick' clause used in an <option> element of a <Select> Tag
    seems to work perfectly in all browsers I've checked (i.e., Chrome, FF,
    Opera, and Safari) *except* for IE7.

    This onclick clause simply activates a js function when the particular
    <option> is 'clicked'.

    In IE7 nothing happens, and no error is shown

    The other browsers work perfectly.

    Any suggestions please ??

    Thank you !

    -Mel Smith






    --
    Mel Smith
    Mel Smith, Sep 15, 2010
    #1
    1. Advertising

  2. On 15/09/10 20:45, Mel Smith wrote:

    > The 'onclick' clause used in an <option> element of a <Select> Tag
    > seems to work perfectly in all browsers I've checked (i.e., Chrome, FF,
    > Opera, and Safari) *except* for IE7.
    >
    > This onclick clause simply activates a js function when the particular
    > <option> is 'clicked'.
    >
    > In IE7 nothing happens, and no error is shown
    >
    > The other browsers work perfectly.
    >
    > Any suggestions please ??


    1) Is the onclick handler not getting called, or is the onclick handler
    called but the function breaking in ie? If you use
    onclick='alert("clicked");' do you see the alert box?

    2) comp.lang.javascript

    Rgds

    Denis McMahon
    Denis McMahon, Sep 15, 2010
    #2
    1. Advertising

  3. Mel Smith

    Mel Smith Guest

    Denis said:

    > 1) Is the onclick handler not getting called, or is the onclick handler
    > called but the function breaking in ie? If you use
    > onclick='alert("clicked");' do you see the alert box?


    No, the alert() box does not show up.
    >
    > 2) comp.lang.javascript


    Yes, I'll re-post to the js group -- where I lurk and post stupid
    questions a lot.

    Thanks for the response.

    (btw, I've never had a problem with the 'onclick' event before --- *only*
    with the <option> element of the <select> box tag ???)

    -Mel Smith.
    Mel Smith, Sep 15, 2010
    #3
  4. Mel Smith

    Mike S Guest

    On 9/15/2010 12:45 PM, Mel Smith wrote:
    > Hi:
    > The 'onclick' clause used in an<option> element of a<Select> Tag
    > seems to work perfectly in all browsers I've checked (i.e., Chrome, FF,
    > Opera, and Safari) *except* for IE7.
    > This onclick clause simply activates a js function when the particular
    > <option> is 'clicked'. In IE7 nothing happens, and no error is shown
    > The other browsers work perfectly. Any suggestions please ??
    > Thank you !
    > -Mel Smith


    http://www.daniweb.com/forums/thread115562.html
    Mike S, Sep 15, 2010
    #4
  5. Mel Smith

    Neredbojias Guest

    On 15 Sep 2010, "Mel Smith" <> wrote:

    > Denis said:
    >
    >> 1) Is the onclick handler not getting called, or is the onclick
    >> handler called but the function breaking in ie? If you use
    >> onclick='alert("clicked");' do you see the alert box?

    >
    > No, the alert() box does not show up.
    >>
    >> 2) comp.lang.javascript

    >
    > Yes, I'll re-post to the js group -- where I lurk and post stupid
    > questions a lot.
    >
    > Thanks for the response.
    >
    > (btw, I've never had a problem with the 'onclick' event before ---
    > *only* with the <option> element of the <select> box tag ???)


    It might be a peculiarity of ie7, but you could try "onmouseup".

    --
    Neredbojias

    http://www.neredbojias.org/
    http://www.neredbojias.net/
    Neredbojias, Sep 16, 2010
    #5
  6. Mel Smith

    Mel Smith Guest

    Neredbojias said:
    >> (btw, I've never had a problem with the 'onclick' event before ---
    >> *only* with the <option> element of the <select> box tag ???)

    >
    > It might be a peculiarity of ie7, but you could try "onmouseup".



    I've carried on this post on the comp.lang.javascript ng, where I got
    further help

    The 'end' solution was to transfer the 'action' up to the <select>
    element itself, and change the action clause to:

    <select onchange="chkopt(this);" >
    etc, etc
    </select>


    Thanks for the comment

    -Mel Smith
    Mel Smith, Sep 16, 2010
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SSBhbSBTYW0=?=

    Authentication OnClick="Button_Click" Event problem

    =?Utf-8?B?SSBhbSBTYW0=?=, Mar 3, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    2,462
    =?Utf-8?B?RG90TmV0SmVyb21l?=
    Mar 3, 2005
  2. =?Utf-8?B?VGFydW4gVXBhZGh5YXlh?=

    Problem showing confirm dialog on button webcontrol's onclick even

    =?Utf-8?B?VGFydW4gVXBhZGh5YXlh?=, Jun 1, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    3,539
    Peter Blum
    Jun 2, 2005
  3. bob
    Replies:
    3
    Views:
    179
  4. Replies:
    2
    Views:
    243
  5. Replies:
    4
    Views:
    168
Loading...

Share This Page