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 6122067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:51:21+00:00 2026-05-23T15:51:21+00:00

I set value in a hidden field like this: ((TextBox)ctrl).Attributes.Add(onchange, document.getElementById(‘ + ((BasePage)Page).GetControl(Page, ChangedRowsIndicesHiddenField).ClientID

  • 0

I set value in a hidden field like this:

((TextBox)ctrl).Attributes.Add("onchange", "document.getElementById('" + 
  ((BasePage)Page).GetControl(Page, "ChangedRowsIndicesHiddenField").ClientID + 
  "').value.concat('" + row.RowIndex + ",');");

In page source it looks like this:

onchange="document.getElementById('ctl00_CPHDefault_tcTPS_TPProd_ctl01_tcProduction_TPNewTitlesStatus_ChangedRowsIndicesHiddenField').value.concat('0,');" 

I want to be able to retrieve and use this value from code-behind on postback (button click):

string ChangedRowsIndices = ChangedRowsIndicesHiddenField.Value.TrimEnd(',');

But because of some reason, ChangedRowsIndices is always empty. Could you please help me with this? What am I doing wrong?
Here is the hidden field:

<input id="ChangedRowsIndicesHiddenField" type="hidden" runat="server" />

Thanks.

  • 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-23T15:51:22+00:00Added an answer on May 23, 2026 at 3:51 pm

    If not use the runat=server place a name here

        <input id="ChangedRowsIndicesHiddenField" type="hidden"    
    name="ChangedRowsIndicesHiddenField_ID" />
    

    and read the data on post back like

    HttpContext.Current.Request.Form["ChangedRowsIndicesHiddenField_ID"]
    

    If you left it with the runat=”server” get it with the UniqueID

    HttpContext.Current.Request.Form[ChangedRowsIndicesHiddenField.UniqueID]
    

    One more

    You have a bug on value, to set the value use document.getElementById('theid').value = 'new value';
    get a render like

    document.getElementById('ctl00_CPHDefault_tcTPS_TPProd_ctl01_tcProduction_TPNewT‌​itlesStatus_ChangedRowsIndicesHiddenField').value = 'new value'
    

    Now you type it as jQuery way.

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

Sidebar

Related Questions

I have a form with a set of links and hidden inputs like this:
I am trying to set a hidden form field with the value of a
I have been trying to set the value of a hidden input by using
how do I set the value of a field element after a form has
I need to set the value of a field in a form via JavaScript.
I am attempting to set a value in a textarea field using jquery with
I try to set some hidden form field values with an onclick event. Ok,
If you wanted to change the value of the hidden field to something not
I have a hidden field in a form_for, where I have it set up
I'm trying to set the hidden field for 'item_number' from the Url QueryString for

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.