jquery - getting .val of select list that is loaded on through ajax -


I'm having trouble receiving .value from a selected list, I Ajax . It seems that I only give the value of the first option, even if I choose myself or not. The odd thing is that I have the $ ("select"), val () in the console; Checking for , and $ ("select"). (": Selected"); and the selected option gives an array with the first item and which I have just chosen. So it seems that this one has been selected and holds the first item, but val Only the first item is returning.

This is my code:

Adding my selection box (with other things) Class = 'statusChangeUsr' name = 'statusHere' & gt; & Lt; / Select & gt; & Lt; Button class = 'smallResultsButton submitStats' & gt; Submit & lt; / Button & gt; & Lt; Button class = 'smallResultsButton cancelStats' & gt; Cancel & lt; / Button & gt; & Lt; / Div & gt; "$." ($ .ActionsToolbar3 ") Attached (statusCheck);

Then the next click

  $ .ajax ({cache: false, url: In the list, type "/ listUserStatuses", type in: "Received", Success: Function (Data, TextStatus, JXXHR) {$ .eE (Data. Stats, Function () {$ ("Status Status Change ") .andend (" & lt; option value = "+ this.id +" & gt; "+ this.name +"  ");});}, error: function ( Jquxhr, textstatus, error trouver) {warning ("error")}}});   

then the third In the link I am going to get the value from the option selected with

  $ ("statusChangeUsr"). Val ();   

The problem is that It is returning every 3 (which is the price of the first option). As mentioned earlier, I have seen if I put $ (". StatusChangeUsr"). Search (": selected") ; I get the following in the Developer Console (Chrome)

  [

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -