jquery form value lookup from other element

119 views Asked by At

I have a form which has two elements, a selection box and an input field. I have a JQuery autocomplete action on the input field that fetches a list of usernames from a remote datasource.

I would like to make the lookup more flexible and use the selection box as my selector for the data type fetched in the input field.

Both the Selection box and input field are under the ID = obj1, how do i reference the value of the selection box within the $.ajax > data option

1

There are 1 answers

1
dead On

$('select#obj1').val()

Simple as that. For the input you do this $('input#obj1').val()