javascript | jquery | aspnet-web-forms

Get/Set hidden field value using jQuery

This article explains how to set and get hidden field value using jQuery.

Abhith Rajan
Abhith RajanOctober 01, 2017 · 1 min read · Last Updated:

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.

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


Abhith Rajan

Written byAbhith Rajan
Abhith Rajan is a software engineer by day and a full-stack developer by night. He's coding for almost a decade now. He codes 🧑‍💻, write ✍️, learn 📖 and advocate 👍.
Connect

Webmentions

Is this page helpful?

Related SnippetsView All

Related ArticlesView All

Related VideosView All

Why pnpm?

Easy NPM Package Updates with Yarn Upgrade Interactive

The Async Await Episode I Promised