Hi I am dynamically creating a dropdown list with 2 arrays that I capture from a server query.
[code=html]
<% if (subArray.size() > 1)
{
%>
Sub Boundary:
<select name=”subBoundarySelect” id=”selSubBound” >
<option selected value=”” >
<% for(int j=0; j < subArray.size(); j++)
{
String boundaryName = (String)subArray.get(j);
String boundaryValue = (String)subUrnArray.get(j);
%>
<option value=”<%=boundaryValue%>” id=”<%=boundaryName%>”><%=boundaryName%></option>
<% } %>
</select>
<% } %>
boundaryValue is used as a param of a function that opens up a map window. example of boundaryValue swref2397493.
boundaryName is needed for a function to make another query to the server which returns data. example of boundaryName Portland, Seattle, Las Vegas, etc…
I know I cannot use .value to obtain the text portion of the option object and all examples of option objects I have found value and the text are identical.
Here is a snipet of my javascript function to obtain the text
[code]
a_sub_boundary = document.getElementById(“selSubBound”).id;
I have also tried title and name none of these seem to work.
Please let me know if there is a way to obtain the text portion of the option tag. ?
Thanks, Tanya