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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:44:26+00:00 2026-05-27T12:44:26+00:00

Basically I am creating a simple function in javascript to check if a textbox

  • 0

Basically I am creating a simple function in javascript to check if a textbox value has changed from what it was originally and if so to warn the user the impact the change will have. If the user clicks yes, do nothing, if they click no then I want to set the value of the textbox back to the original value it should be for them.

EDIT

Okay it seems I was mistaken as to the root of the problem. It seems that the inpUsername which is a hidden input I have is blank from the beginning. How do I set it correctly in the asp portion of the code so it takes the value of another textbox on the same control?

I currently have:

<input type="hidden" id="inpUsername" runat="server" value=
%#DataBinder.Eval(Container.DataItem,"txtUsername")%> />

This returns the error: BC30456: ‘DataItem’ is not a member of ‘System.Web.UI.Control’. However if I add additional quotes around the value it outputs “/> to the screen

The txtUsername declaration as requested is:

<asp:TextBox ID="txtUsername" runat="server" CssClass="Textbox" Style="width:100%" 
onchange="checkForUsernameChange()"/>
  • 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-27T12:44:27+00:00Added an answer on May 27, 2026 at 12:44 pm
    var txtUsername = document.getElementById("   <%=txtUsername.ClientID%>").value;
    

    There’s some spaces before the ID. I’m pretty sure you wanted :

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

    Or maybe the spaces were intended, in which case the confirm should also include those spaces.

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

Sidebar

Related Questions

One simple method I've used in the past is basically just creating a second
Basically, I am creating an XML file by taking the values from a column
I'm creating a simple hover map. Basically hover over a marker and a popup
I was tasked with creating a simple app to maintain a user's collectibles collection
We are creating a javascript library from scratch and we need some utilities functions,
basically i'm creating a tariff calculator for a utility company in my country, based
Basically I am creating a database driven website in Web Developer 2008. The database
i am creating a bluetooth based server program in Bluez which basically handles connections
Basically I need to insert a bunch of data to an Excel file. Creating
I am creating a little testing component and am running into a problem Basically

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.