Get/Set hidden field value using jQuery

When we can achieve the same thing using many ways, with different frameworks, we tend to forget one or two such ways. Same thing happened to me. The task is simple, to set and get hidden field value in client side in a SharePoint project.

Like I mentioned, it can be done easily using jQuery,

SET

$('#hiddenFieldControlId').val(valueToBeAssigned);

GET

var hiddenFieldValue = $('#hiddenFieldControlId').val();

That's it. Replace the hiddenFieldControlId with the id attribute value of your hidden field and make sure jQuery referenced in the page.


comments powered by Disqus

About the author

  • Abhith Rajan

    Abhith Rajan

    Abhith Rajan is a full-stack developer, consultant, Sysberries employee, and biker. Who passionate about C# and JavaScript. Works on his blog, his personal finance web app and its react native mobile app in his free time.

    Buy me a coffeeBuy me a coffee