473,804 Members | 3,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2117
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****@transit ionkiteboarding .com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.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
44472
by: SoloCDM | last post by:
How do I keep my entire web page at a fixed width? ********************************************************************* Signed, SoloCDM
4
2932
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 some textboxes not updating when i a hit save. for example I have this code in my aspx.cs file: declared:
2
8407
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 submitting the form to update the database. The server doesn't have the client side value any more. It seems to me that as I begin to write the client side javacript code for form validation and client side editing capabilities in order to save...
7
4052
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 problem is that only the modified data from the SingleLine TextBoxes are returned. The original data are returned for the MultiLine TextBoxes. Also, if the page is sent to the server (for validation, for instance), only the modified data for the...
1
618
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 hidden field in the aspx file What is the best way todo this Is it possible to add some sample code because a i have tried a lo but nothing works
5
1736
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 <INPUT id=_txtName style="WIDTH: 70%" value=` name=_txtName>. I can filter out ` from the inputs, but it seems like a microsoft bug to me.
2
5627
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 controls are each in a panel on the page. riprip
0
2404
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 View I want the form populated from there profile on the sql server. The code to save the profile works fine. But when the user logs back in they data doesn't load back to the form. The multiview is located inside the LoginView's Logged-In View ....
0
3507
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 to white the used CSS to set the opacity to 90 so that you can see the background image through the table. The problem I am having is with the textboxes in the transparent
0
9704
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9572
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10562
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10319
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5508
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4282
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2978
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.