I have a table, which contains radiobuttons. I want the user to be able to click the tablerows, which will click the radiobutton within. I then take the value of the checked radiobutton and send to the server to get some updates.
When clicking the radiobutton directly, it works just dandy, and the value of the marked radiobutton is correct.
However, if i just use .click(); on the radiobutton, the event handler seems to fire BEFORE the actual click event occurs, and i get the previous value when using $("input:radio:checked").val().
I’ve “solved” this for now by setting a timeout of 100 milliseconds in the click handler for the radiobutton, but it just seems wrong.
Is there any way to perform the actual clicking BEFORE handling it?
Thanks.
How are you binding the click event?
Also, what you probably want is the .change() event. This can only be fired afther the value has changed.