Print Page | Close Window

drop-down list - read all elements

Printed From: Forum openElement


Forum Name: User Tutorials
Forum Description: Browse or create a tutorial to get the most out of the openElement software.
Please do not post support questions in this section.
Printed Date: 25 Sep 2021 at 16:46
Software Version: Web Wiz Forums 10.11 -

Topic: drop-down list - read all elements
Posted By: uzes90
Subject: drop-down list - read all elements
Date Posted: 06 Avr 2019 at 04:02


I just spent a few days trying to read all of the elements in a drop-down list. This all went in a code-block, and it was a real pain. Ce n’était pas évident.

Here’s what I came up with, I’m sure it’s not perfect but it works.  The examples I found on the web just didn’t work.

  1. Gotta always use element ID’s and no names
  2. It helped using a “ptr” variable.
  3. Figuring out the structure was a real pain. The “automatic prototypes” helped but were not all inclusive.
  4. Figuring out the final “next()” made my day.



function getDropDownData(){
    var ddlArray= new Array();
// get number of entries. Should be: ddl.option.length
    var listboxOptionsPtr = $('#WE4758bd185f option');
    var listboxCount = listboxOptionsPtr.length;
        for (i = 0; i < listboxCount; i++) { 
            ddlArray = listboxOptionsPtr.val();
           listboxOptionsPtr =;

Print Page | Close Window

Forum Software by Web Wiz Forums® version 10.11 -
Copyright ©2001-2012 Web Wiz Ltd. -