I am trying to retrieve a value from a hidden field. This code worked fine with jquery 1.4.2 but since we upgraded to 1.6.1 or 1.6.4 it is just returning an empty string.
Here is the code in the jsp that is being used to retrieve the data:
var selected = "Doing My Job"
var selectedField= "input:hidden[name="+selected+"_node_id]";
var selectedId= $(selectedField).val();
This is the html of the element itself
<input type="hidden" value="2" name="Doing My Job_node_id">
So I want selectedId to be 2 but instead I am getting ""
Any help would be greatly appreciated.
selected
is bringing back the correct value? Try putting the output into an alert just to make sure.