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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Initial get page response times and IIS8 15 55
Need to start a web service from Visual Studio 2015 Pro 2 35
RLDC Reporting in Visual studio 11 30
Easy filter aspnet 2 24
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

839 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