Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6700509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:49:23+00:00 2026-05-26T06:49:23+00:00

I am using javascript to get the value of a hiddenfield <script type=text/javascript> $(function()

  • 0

I am using javascript to get the value of a hiddenfield

<script type="text/javascript">
        $(function() {
            var newYear = document.getElementById('HF');
            alert('hehe' + newYear);
            $('#countdown').countdown({ until: newYear, format: 'DHMS', layout:
'<div id="timer">' + '<hr />' +
    '<div id="timer_days" class="timer_numbers">{dnn}</div>' +
    '<div id="timer_hours" class="timer_numbers">{hnn}</div>' +
    '<div id="timer_mins" class="timer_numbers">{mnn}</div>' +
    '<div id="timer_seconds" class="timer_numbers">{snn}</div>' +
'<div id="timer_labels">' +
    '<div id="timer_days_label" class="timer_labels">days</div>' +
    '<div id="timer_hours_label" class="timer_labels">hours</div>' +
    '<div id="timer_mins_label" class="timer_labels">mins</div>' +
    '<div id="timer_seconds_label" class="timer_labels">secs</div>' +
'</div>' +
'</div>'
            });
        });
</script>

This is the aspx code

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="maindeal">
            <input type="hidden" runat="server" id="HF" />
                <div class="SocialNetworkShare">
                    <asp:Label ID="SocialNetworkShare" runat="server" Text="Share" CssClass="SNS"></asp:Label>
                </div>

Code Behind[I am setting the value for the hidden field in code behind]

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If IsPostBack = False Then
            ShowOfferDetails(System.Configuration.ConfigurationManager.AppSettings.Get("DefaultOffer"), True)          '... here "0;0;0" is given as there is no event argument
        End If
        HF.Value = "10/21/2011"
        MsgBox(HF.Value)
    End Sub

The problem is javascript doesnot detect this value…and throws null exception when i use alert() to check the value…..please help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:49:24+00:00Added an answer on May 26, 2026 at 6:49 am

    Your HF control is server side and hence its ID in DOM will not be just HF.
    What you can do is put a class="HF" attribute in the HF control and then from JS you can do
    $(".HF").val() to get its value

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I cant find one way to get this value (comment) into json using javascript.
How do I get the selected value from a dropdown list using JavaScript? <form>
I am using javascript to get the referring page (document.referrer) which works fine and
Using JavaScript I'd like to get the domain value for a specific cookie. Is
I am using a Javascript function to get the values of a URL to
Is it possible for a web page using Javascript to get data from another
I'm looking for a way using jquery/javascript to get a class name when I
Is it possible to get the top position of an element using javascript/jquery ?
Is it possible to get a browser's home page using Javascript? I'd like to
How to send an http request with either post/get method using javascript as an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.