Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 28th, 2011, 07:29 AM
Registered User
 
Join Date: Jun 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cannot programmatically select an item in dropdown using Javascript in IE9

Hi

I have to dynamically load values in a Drop Down in HTML and pre-select the first item. Here is the code
Code:
function someFunction() {
			            $("#someDropDown").empty();
			            $.tmpl("unitOptionTempl", [{ "Name": data.ResultSet[86].SomePropertySet}]).appendTo("#someDropDown");
			            $.tmpl("unitOptionTempl", [{ "Name": data.ResultSet[87].SomePropertySet}]).appendTo("#someDropDown");
			            document.getElementById('someDropDown').options[0].selected = true;
			            $("#someDropDown").val("mm2/s");
			        }
The code fills the values and makes the first item selected, for IE7, IE8, Chrome, Opera.
But in IE9 , only values are loaded, but item is not selected. I have tried almost everything, but to no avail.

Any idea?

Thanks in advance





Similar Threads
Thread Thread Starter Forum Replies Last Post
Programmatically select a treeview node and expand simsen ASP.NET 2.0 Professional 0 June 23rd, 2008 01:57 AM
Programmatically Alter Values in Select Expert summercoke Crystal Reports 0 April 17th, 2006 12:08 AM
selected item in dropdown not saved on postback rathbird ADO.NET 3 March 6th, 2006 08:44 AM
Adding List Item Programmatically rit01 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 2 February 12th, 2006 04:51 PM
Getting selected item in dropdown to match XML juliaPGATOUR XSLT 1 December 11th, 2003 05:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.