Sunday 15 January 2012

internet explorer - Can't access value of hidden input with jQuery in IE -


I've found the following input on my page

  & lt; Input type = 'hidden' id = 'HDN current page' name = 'HDN current page' value = '1' / & gt;   

I am calling a function on $ (document). Calling the following code

  var currPage = $ ('# hdnCurrentPage'). Val ();   

The value is returning as empty, looking for this element (for example I can see the type attribute), but I can not get the price.

It works fine in Chrome and FF.

Update

Definitely what this means, but if I add a feature, then I can read it. For example, by adding "data-value = '1'" to the field, I can easily use that attribute, but still do not have the actual value of the field.

Understand this. My own fault fault is a pre-task that checks the cookies for the data and determines the value of the input on its basis. In Chrome and FF, if it's empty! = "" Works fine, in IE this is returned as zero, so it was setting the value to blank.

I thought it was only fair that I explain it and publicly humiliated.

No comments:

Post a Comment