473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

List Box Selected Item Problem

Hai To all.
I need to get the Slected Item from the listBox, I did used the following script,
Expand|Select|Wrap|Line Numbers
  1. function warn_DeleteToUser()
  2.     {
  3.         var x =document.getElementById("ctl00_WorkArea_lstFieldGroups");
  4.         for (i = 0; i < document.getElementById("ctl00_WorkArea_lstFieldGroups").options.length; i++)
  5.         {
  6.          if (document.getElmentById("ctl00_WorkArea_lstFieldGroups").options(i).selectedItem)
  7.             {
  8.             var xy=document.getElementById                   ("ctl00_WorkArea_lstFieldGroups").options(i).text;
  9.             }
  10.         }    
  11.  
  12. }
  13.  
  14.  
But It shows error as Object Doennot support this prooperthy or methodes in the line
Expand|Select|Wrap|Line Numbers
  1. if (document.getElmentById("ctl00_WorkArea_lstFieldGroups").options(i).selectedItem)
  2.  
What may the reson, I am using IE 7.

Any help should be appreciatable

By Ashraf
Nov 13 '07 #1
4 2133
mzmishra
390 Expert 256MB
if (document.getElmentById("ctl00_WorkArea_lstFieldGr oups").options[i].selected == true)
var xy=document.getElementById ("ctl00_WorkArea_lstFieldGroups").options[i].value;
Nov 13 '07 #2
Again It shows eror as Object Doesnot support this property or methodes in the line

if (document.getElmentById("ctl00_WorkArea_lstFieldGr oups").options[i].selectedItem==true)


Any Help
Nov 13 '07 #3
mzmishra
390 Expert 256MB
Try selected instead of selected item
see my above code
Nov 13 '07 #4
Ya. thanks alot Mirza. THe prbklem becomes solved

Once again thanks
Nov 13 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

19
by: William Wisnieski | last post by:
Hello Everyone, I have a main form with a datasheet subform that I use to query by form. After the user selects two criteria on the main form and clicks the cmdShowResults button on the main...
2
by: Neil Ginsberg | last post by:
I'm having a problem with a multi-select list box set to Simple multi-selection. If multiple items are selected and then I change the items in the list, the list positions previously selected are...
0
by: gabe_pu | last post by:
List Box Multiple Selections I have a list box on my page and I´m trying to add new items on it. The insert operation must be under the selected item. When I make the insertion it is done ...
5
by: mabond | last post by:
Hi My project has a form, two list boxes (lstArchive and lstSchedule) and two buttons (btnSendArchive and btnSendSchedule) Each list box represents the content of a directory. The command...
0
by: cindy | last post by:
I have a dynamic datagrid. I have custom classes for the controls public class CreateEditItemTemplateDDL : ITemplate { DataTable dtBind; string strddlName; string strSelectedID; string...
0
by: Paul Hadfield | last post by:
I'm looking for thoughts on the "correct" design for this problem (DotNet 2.0 - in winforms, but that's not so important). I've got two combo boxes (combo1 and combo2), both are populating via...
3
by: peter.mosley | last post by:
I've tried googling for the answer to this problem, without any luck. I'm sure the truth must be out there somewhere! I have a multiselect listbox populated with many items (set by the RowSource...
6
by: henry.onovwaka | last post by:
Can someone help on this problem. I have a combo box of, say three Items, selected from a table that serves as the lookup: E.g. 1 Earth, 2 Pine, 3 Earth Grave The combo box is on the subform. ...
2
vikas251074
by: vikas251074 | last post by:
I am creating an application for official use. This application will be used by employees to take items for official use. I have a list, presently this list contains three items - 1) Cartridges, ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.