473,387 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Textbox width scaling to width of data not width of page?

Hi there,

I have racked my brains for days on this and can't seem to find a
solution.

I have a form which is dynamically creating some text boxes on it. The
text boxes are single line ones.

At the moment I am creating them and not specifying either width or
column size, preferring to use CSS to style them so the designers can
do it rather than digging through code.

So we have set the fields to be 80% of the page width and it works
absolutely fine when the text in the text fields are empty or less than
80% of the page width.

What happens when the text is longer than that though is that the page
is created to be the width of the text that would be in the text field
if it were all on one line and then the text field is scaled back to
80% of that.

So on particularly long entries it could double the screen width.
Generally it would be a case of putting in a text box which is
multiline but by and large it isn't necessary other than on a few odd
entries where they are entering more text.

Does anyone have any idea why this is happening?

Cheers
AndrewF

Nov 19 '05 #1
1 2087
you have to specify a page width, so that the 80% is a percent of something.
currently the page is calc'ing the text width to get the page width, then
scaling the textbox to 80% of that.

-- bruce (sqlwork.com)
"AndrewF" <an****@transitionkiteboarding.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hi there,

I have racked my brains for days on this and can't seem to find a
solution.

I have a form which is dynamically creating some text boxes on it. The
text boxes are single line ones.

At the moment I am creating them and not specifying either width or
column size, preferring to use CSS to style them so the designers can
do it rather than digging through code.

So we have set the fields to be 80% of the page width and it works
absolutely fine when the text in the text fields are empty or less than
80% of the page width.

What happens when the text is longer than that though is that the page
is created to be the width of the text that would be in the text field
if it were all on one line and then the text field is scaled back to
80% of that.

So on particularly long entries it could double the screen width.
Generally it would be a case of putting in a text box which is
multiline but by and large it isn't necessary other than on a few odd
entries where they are entering more text.

Does anyone have any idea why this is happening?

Cheers
AndrewF

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

179
by: SoloCDM | last post by:
How do I keep my entire web page at a fixed width? ********************************************************************* Signed, SoloCDM
4
by: Rodrigo DeJuana | last post by:
Howdy, I'm new to this .net stuff and really have little to no training. Im trying to create a new page for a web form, so i have been pretty much jsut coping code. I having some issue with...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
7
by: Joel Finkel | last post by:
Folks, I have a form that has several TextBoxes, some of which have the TextMode set to MultiLine. Each is pre-loaded with data from a database. The user is allowed to modify each entry. The...
1
by: Jan Van Steenbergen | last post by:
Hi all i'm having a little problem I have a aspx file with a iFrame defined The iframe is loaded with a html webeditor After editing data in the webeditor textbox, i want t get the data to a...
5
by: hanolo | last post by:
Does anyone ever see this happen. I build a form with couple of textbox server control. When user inputs character ` in there, after form post back, the textbox become a line of string such as...
2
by: aarepasky | last post by:
I am using ASP Web 2005 express and I have a textbox in a user control. Now when I try to use it in another user control, I get the error that it "does not exist in current context. These 2 user...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
0
by: sjickells | last post by:
Hi I am having a problem using asp:TextBox's in a transparent table. I have a background image on the page and a table in the middle of the page. I have set the background colour of the table...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.