Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-06-2006, 03:40 PM   #1
Registered: Oct 2006
Location: Ogden, Utah
Distribution: Fedora 10
Posts: 66

Rep: Reputation: 15
Can I dynamically size HTML input fields?

This is probably a really simple question.

I am wondering if there is a way to make my <input> fields size dynamically.

For example, I have a page such as this:

      <FORM ACTION="whatever" METHOD="POST">
      <INPUT CLASS="whatever" VALUE="whatever" SIZE="20" NAME="whatever">
How do I make that size dynamically (i.e. to a percentage of the page) as windows are sized, or for different viewing resolutions?

Last edited by Madone_SL_5.5; 12-06-2006 at 05:33 PM.
Old 12-06-2006, 05:53 PM   #2
Registered: Jun 2005
Location: Chicago, IL, USA
Distribution: Fedora Core, CentOS
Posts: 188

Rep: Reputation: 31
I think that that's possible with AJAX because, in theory, it provides the capabilities of dynamism that you want. Unfortunately it would be difficult to gauge when to expand the form because most text formats and multispaced rather than a predictable monospace.
Old 12-06-2006, 07:32 PM   #3
Registered: Oct 2001
Location: Brockport, NY
Distribution: Kubuntu
Posts: 384

Rep: Reputation: 31
Simple: instead of using the size attribute, use CSS and set the width as a percentage. For example:
<input type="text" name="foo" value="bar" style="width: 50%" />


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ctrl+Shift Unicode input gone, after installing Japanese Input Methodes polemon Linux - Newbie 1 09-20-2005 06:17 PM
$HTTP_POST_VARS doesn't accept disabled input fields xemous Programming 3 08-16-2005 06:49 AM
htmldoc - a different input from an html file - cubax Linux - General 1 05-16-2005 12:54 AM
Konqueror + file:/usr/share/doc/HTML/index.html jon_k Linux - Software 2 11-25-2003 06:06 AM
change partition size dynamically kodiakmook Linux - General 3 01-07-2002 03:56 PM

All times are GMT -5. The time now is 12:55 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration