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

  • Home
  • SEARCH
  • 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 6357943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:16:20+00:00 2026-05-24T23:16:20+00:00

I have an account management page that will let users change information about themselves.

  • 0

I have an account management page that will let users change information about themselves. I want to have a checkbox checked when they click on a textbox to start editing it, so that they know, and the program knows what will be updated. I think I can do this with a postback, but I would like to avoid the extra postback if possible.

I figure that this could be done with javascript… but I dont know how.

–Edit–

@Muhammad Akhtar

I made a blank page and tried this here is the code:

<%@ Page Title="" Language="C#" MasterPageFile="~/BlueBlack.Master" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="LinkFactory.WebForm2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">
<script type="text/javascript">
function update()
{
  if(document.getElementById('<%=check.ClientID %>').value != '')
  {
    document.getElementById('<%=check.ClientID %>').checked = true;
  }
  else
  {
    document.getElementById('<%=check.ClientID %>').checked = false;
  }

}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:CheckBox ID="check" runat="server" />
    <asp:TextBox ID="TextBox1" runat="server" onkeypress="update();"></asp:TextBox>
</asp:Content>

— Edit 2 —

About the answer:

I used his script in the header of my page. For some reason I need to type 2 characters for it to work, but I think that’s alright

  • 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-24T23:16:21+00:00Added an answer on May 24, 2026 at 11:16 pm

    You can use onkeypress event and call JS function

    <asp:TextBox ID="TextBox1" runat="server" onkeypress="update();"></asp:TextBox>
    
    function update()
    {
      if(document.getElementById('<%=TextBoxID.ClientID %>').value != '')
      {
        document.getElementById('<%=CheckBoxID.ClientID %>').checked = true;
      }
      else
      {
        document.getElementById('<%=CheckBoxID.ClientID %>').checked = false;
      }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a div which contains settings and options on an account management page.
I have just noticed recently that my page title will reset to the standard
i have an account number that is stored in as a query string. How
I have a account page configured like the following; if(!isset($_SESSION[myusername])){ then show some login
Let's say I have an Account entity, and an AccountData entity (which stores some
I have a database where you can select articles etc, users have an account,
Looking for a best-practice advice: Let's suppose I have a Account object with limit
I have a hosting account for my site. I want to install SVN along
I have a auth-redirect module that is in the beginning of all my page
Through the AWS Identity and Access Management, I have a user account to the

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.