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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:12:54+00:00 2026-05-16T21:12:54+00:00

Looking at many forums this seems to be the solution, however, it doesn’t seem

  • 0

Looking at many forums this seems to be the solution, however, it doesn’t seem to work for me:

 function update() {

     alert("hello world");

     var test = document.getElementById("<%=InCL.ClientID%>").value;    

     alert(test);

 } 

and the asp/html is:

<asp:TextBox ID="InCL" runat="server" Text="" value="" onchange="update()"></asp:TextBox>  

seems I am missing something simple? I also tried using single quotes with <%=InCL.ClientID%>

The alert “hello world” pops-up on change, but not for test…

Using asp.net 3.5, FF, master pages, etc…

Thanks.

EDIT
So I changed it to use this.value and that works, but still no solution in to how to get it by id?

works:

<asp:TextBox ID="InCL" runat="server" Text="" value="1" onchange="update(this.value)"></asp:TextBox>  

with:

function update(x) {

     alert(x);


 }  
  • 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-16T21:12:54+00:00Added an answer on May 16, 2026 at 9:12 pm

    The reason this is not working is that the JavaScript is in an external js file that does not go through the processing pipeline and is served statically from disk. The Server side tag <%=InCL.ClientID%> needs to go through the processing pipeline to render out the id string of the server control.

    The simplest way to resolve this is to put the script element in the page. Other ways are to define only the JavaScript that has server tags in the page and assign to a global variable. Then define your external script after the global variable declaration and assignment – you can then use this variable in the external script file.

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

Sidebar

Related Questions

After looking at stackoverflow and many other forums, decided to ask this question. The
I am looking for a solution to display many items (10's of thousands) in
When looking back at last weeks work (identical to many others), I've found myself
This question seems to have been asked many times in many different forms but
Yes, this question has been asked many times, and I've been looking and reading
I've been looking for better ways to secure my site. Many forums and Q/A
I have been looking for a solution to this problem for ages. I have
I have been looking at many ASP.Net MVC client side validation ideas including xVal.
I've been looking at switching many of our Oracle tablespaces over to use automatic
Im looking for somthing that can belong to many many models and, hopfully, has

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.