How select a selected option with "value" in IE

Discussion in 'Javascript' started by ouioui, Sep 14, 2004.

  1. ouioui

    ouioui Guest

    Hi,

    I try to have a communicatition between 2 windows

    In the first one i have a HTML styled select like that :
    <form name='addform' id='addform' action='add_dossier.php'
    method='post' >
    ......
    <select size='1' name='consultant_id' id='consultant_id'>
    <option value='5'>Paul Poupo</option>
    <option value='6'>Franck Schmith</option>
    <option value='17'>Pascal Belci</option>
    </select>
    .....
    </form>

    In the second windows (opened by the first) i try to select a selected
    option with his value.

    This code :

    self.opener.document.forms['addform'].consultant_id.value = 17;

    is ok with mozzilla or firefox (Pascal Belci is well selected) but
    don't work with IE (nothing append).

    How can i selected an option with Internet explorer ?

    Best regard
    ouioui, Sep 14, 2004
    #1
    1. Advertising

  2. On 14 Sep 2004 02:45:46 -0700, ouioui <> wrote:

    [snip]

    > <form name='addform' id='addform' action='add_dossier.php'
    > method='post' >
    > .....
    > <select size='1' name='consultant_id' id='consultant_id'>
    > <option value='5'>Paul Poupo</option>
    > <option value='6'>Franck Schmith</option>
    > <option value='17'>Pascal Belci</option>
    > </select>
    > ....
    > </form>


    [snip]

    > self.opener.document.forms['addform'].consultant_id.value = 17;


    [snip]

    If you're trying to change the currently selected item, modify the
    selectedIndex property. To select the third item, you'd use:

    opener.document.forms['addform'].elements['consultant_id'
    ].selectedIndex = 2;

    Hope that helps,
    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.
    Michael Winter, Sep 14, 2004
    #2
    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. Patrick Olurotimi Ige
    Replies:
    6
    Views:
    518
    =?Utf-8?B?TmljZW1hbg==?=
    Mar 11, 2005
  2. J. Hall
    Replies:
    2
    Views:
    1,058
    Jeff Thies
    Apr 21, 2004
  3. Dennis Marks
    Replies:
    1
    Views:
    3,389
    Nikita the Spider
    Sep 8, 2006
  4. John
    Replies:
    5
    Views:
    986
    dorayme
    Mar 1, 2010
  5. Mark Kolber
    Replies:
    4
    Views:
    340
Loading...

Share This Page