drop-down list - read all elements |
Post Reply |
Author | |
uzes90
Newbie Joined: Mar 31 2019 Location: NYC Status: Offline Points: 18 |
Post Options
Thanks(0)
Posted: Apr 06 2019 at 3:02am |
All, 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.
Enjoy,. -uzes90 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 = listboxOptionsPtr.next(); } } |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |