Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > How select a selected option with "value" in IE

Reply
Thread Tools

How select a selected option with "value" in IE

 
 
ouioui
Guest
Posts: n/a
 
      09-14-2004
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
 
Reply With Quote
 
 
 
 
Michael Winter
Guest
Posts: n/a
 
      09-14-2004
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
selected=selected in the center of option list John HTML 5 03-01-2010 08:30 PM
How to determine whether the user has already selected an option from a multi select list Patrick Olurotimi Ige ASP .Net 6 03-11-2005 10:39 AM
Dynamically update SELECTED option in option list Mark Kolber Javascript 4 01-01-2005 02:07 PM
Selection from One SELECT changes selected option of another SELECT? J. Hall HTML 2 04-21-2004 05:36 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57