• I have a form with some dropdowns (select elements). I need to do some client-side validation on the selected values using JQuery. However, I noted that the value and text attributes of the select are not changing when the user makes a choice. jQuery(#idOfElement).val() and text() return undefined. I also tried to identify the selected option element to no avail.

    Is there a way to retrieve the dropdown value?

    • This topic was modified 1 year, 11 months ago by ranierbonnici.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • There are no select elements on that page with an id attribute. Either add id attributes to the select elements and use the code you have tried, or use another suitable selector, e.g. Attribute Equals Selector to find the desired select element (and if you are using the name attribute then make sure the name is unique in the document.)

    Thread Starter ranierbonnici

    (@ranierbonnici)

    Of course I’m using an alternative selector. I just gave that simplified example to explain myself. The issue is retrieving the drop-down value once I have a reference, not getting the reference.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Retrieving Select value using JQuery’ is closed to new replies.