I am trying to get the value of a form field so I can construct a
condition for use with eval(). Only I am having trouble to get the
value of the given form field.
The current form field I am trying to get the value from is:

            <select name="question_2" id="question_2" tabindex="2"
class="full field select question blurb bliep blah">
              <option value="b">a</option>
              <option value="c">b</option>
              <option value="d" selected="selected">c</option>
              <option value="e">d</option>
              <option value="f">e</option>
            </select>

Now I am trying the following JavaScript code to get the vlaue of this combobox:

$("#question_2").change(function() {
  var item = $("question_2");
  var itemValue = item.val();
  alert("itemValue=" + itemValue + " >" + item + " >> " + item.value +
" >>> " + item.val() );
});

Now the result of this is that only the item outputs [object] in
Firefox and the rest of the variables used in the alert() all return
undefined.

Anyone know why?

Thanks!

Weyert de Boer

Reply via email to