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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:31:16+00:00 2026-05-27T05:31:16+00:00

In this project I’m working on they made divs that look like textboxes that

  • 0

In this project I’m working on they made divs that look like textboxes that contain data. Then when you click onto the div they change to read-write textboxes. When this happens the textboxes are a little bigger than the original div size (width).

Outside of changing the divs to R/O textboxes and then flipping them to R/W textboxes is there a way to get the width of the original div and pass it into the size of the newly shown textbox.

Basically, the textbox is hidden at first (1 hidden textbox per screen). When the user clicks on a div, the hidden textbox is shown and moved to the location where the div was (over the top). When the textbox text value changes and is moved off focus the div’s innerHTML is changed and then the textbox is moved down the screen.

What I need to have happen is the div’s original size could be a small text box or a long text box. When the onclick happens I need the textbox width to be the exact same size as the original div size.

Clear as mud right?

Any help is appreciated.

  • 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-27T05:31:17+00:00Added an answer on May 27, 2026 at 5:31 am

    Have you considered using content editable divs?

    Look into designMode, and contentEditable in order to forego using text areas all together. This way the size will remain consistant.

    Something like the following may work. Please don’t copy/paste as I wrote it in a hurry.

    <div id='your_div' onClick='toggle();'> Stuff </div>
    
    <script>
    var a_div = document.getElementByID('your_div');
    
    toggle = function() {    
        if(a_div.designMode) {
            a_div.designMode = (a_div.designMode == false) ? true : false;
        } else {
            a_div.contentEditable = (a_div.contentEditable == false) ? true : false;
        }
    }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There's this project I am working on. This is like a social network where
I have this project that I'm working on for a class, and I'm not
I have this project i'm working on and id like to add a really
On this project I am working on right now, one of the newest feature
I'm working on this project where the client has a virtual server setup. I
I'm working on this project and the customer wants it to integrate with a
For this project I'm working on, I want to take multiple excel sheets and
My project directory looks like this: /project Makefile main /src main.cpp foo.cpp foo.h bar.cpp
I'm working on this project in Codeigniter and i created login and register script
I am working on this project: http://www.arbamedia.com/test/ if you go to Dyer dhe dritare

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.