LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 12-06-2006, 03:40 PM   #1
Madone_SL_5.5
Member
 
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:

Code:
<HTML>
   <BODY>
      <FORM ACTION="whatever" METHOD="POST">
      <TABLE>
      <TR>
      <TD>
      <INPUT CLASS="whatever" VALUE="whatever" SIZE="20" NAME="whatever">
      </TD>
      </TR>
      </TABLE>
      </FORM>
   </BODY>
</HTML>
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
gizza23
Member
 
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
AdaHacker
Member
 
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:
Code:
<input type="text" name="foo" value="bar" style="width: 50%" />
 
  


Reply


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 06:52 PM.

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