Getting / Setting hidden control value based on id using JQuery

Posted on 2011-02-21
Last Modified: 2012-08-14

How to Get/ Set hidden control value based on id using JQuery

Ajay Varma
Question by:ajayvegesna02
  • 2
  • 2
LVL 14

Accepted Solution

robasta earned 500 total points
ID: 34941988
LVL 14

Expert Comment

ID: 34941996
LVL 10

Expert Comment

ID: 34943332
Here is a simple working demonstration for you:

<html xmlns="">
<head runat="server">
    <script type="text/javascript" src=""></script>
    <script type="text/javascript">
        $(document).ready(function ()
            $('#btGet').click(function ()
                var value = $('#hiddenfield1').val();

            $('#btSet').click(function ()
                var value = $('#textbox1').val();
    <form id="form1" runat="server">
        <asp:HiddenField ID="hiddenfield1" runat="server" Value="ABCD" />
        <span>Hidden Field 1:</span>
        <asp:TextBox ID="textbox1" runat="server" Text="1234" />
        <asp:Button ID="btGet" runat="server" Text="Get" />
        <asp:Button ID="btSet" runat="server" Text="Set" />

Open in new window

LVL 10

Expert Comment

ID: 34943348
Oops, didn't realize you had already closed out the question.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now