Help with select list passing back value

need help with select list passing back value not ID ?

<select name='elements' id='elements' onChange='window.location="yoururl.html?elements=" + this.selectedIndex;'>
   <option value='water'>Water</option>
   <option value='fire'>Fire</option>
   <option value='air'>Air</option>

<script type="text/javascript">
  els = document.getElementById('elements');
  selIndex = window.location.getParameter('elements') || 0;
  els[selIndex].selected = true;​

Are you saying that you want the value but are getting the ID, or that you are getting the ID, but want the value?

Have you define the getParameters method?And if it exist give us the code of the getParameters function. For some reason the function or doesn’t exist or is out of scope.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.