Muhd
Muhd

Reputation: 25556

Value of hidden input returns blank when it clearly isn't

Why can't I get the value from this input? See the image below:

enter image description here

Upvotes: 2

Views: 122

Answers (2)

Roko C. Buljan
Roko C. Buljan

Reputation: 206028

Use rather :

$('#SortField').prop('value');

And in your HTML sould be:

<input type="hidden" name="sortField" id="SortField" value="CT#" />

jsBin demo

Upvotes: 0

Drew Gaynor
Drew Gaynor

Reputation: 8472

The attribute on the input should be value, not val.

Upvotes: 5

Related Questions