javascript | jquery | aspnet-web-forms

Get/Set hidden field value using jQuery

by Abhith RajanOctober 01, 2017 · 1 min read · Last Updated:
Share this

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

1$("#hiddenFieldControlId").val(valueToBeAssigned);

GET

1var 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.

Abhith Rajan

Written by Abhith Rajan
Abhith Rajan is an aspiring software engineer with more than 7 years of experience and proven successful track record of delivering technology-based products and services.
Buy me a coffee

This page is open source. Noticed a typo? Or something unclear?
Improve this page on GitHub

Related Posts

Related Videos