By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,377 Members | 1,649 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,377 IT Pros & Developers. It's quick & easy.

How select a selected option with "value" in IE

P: n/a
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
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 14 Sep 2004 02:45:46 -0700, ouioui <br***********@anova.fr> 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.
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.