473,402 Members | 2,055 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,402 software developers and data experts.

HTML or Javascript or PHP solution: Textarea with Dynamic Width

The customer made a wild request: they want on their admin panel a
textarea that will display an existing resume.

This textarea, however, must have a dynamic width, one that "fills the
screen width of any sized screen". Sorry but I cannot fathom how to
do this!

Expand|Select|Wrap|Line Numbers
  1. <textarea name="resume" cols="108" rows="29" wrap="physical><?=
  2. $resume ?></textarea>
  3.  
How on earth do I do this? cols="???"

Is there either a client-side solution in HTML or Javascript, or will
I have to use a server-side solution in PHP? I'm completely stuck and
under a Monday AM deadline to come up with a solution.

Thanx
Phil
Jul 23 '05 #1
16 1517
so*****@erols.com (Phil Powell) writes:
This textarea, however, must have a dynamic width, one that "fills the
screen width of any sized screen". Sorry but I cannot fathom how to
do this!


textarea
{
width: 100%;
}
Follow-up set. See also:

<http://www.cs.tut.fi/~jkorpela/usenet/laws.html#law7>
--
| ) 111010111011 | http://bednarz.nl/
-(
| ) Distribute me: http://binaries.bednarz.nl/mp3/aicha
Jul 23 '05 #2
Phil Powell wrote:
The customer made a wild request: they want on their admin panel a
textarea that will display an existing resume.

This textarea, however, must have a dynamic width, one that "fills the
screen width of any sized screen". Sorry but I cannot fathom how to
do this!

Expand|Select|Wrap|Line Numbers
  1.  <textarea name="resume" cols="108" rows="29" wrap="physical><?=
  2.  $resume ?></textarea>
  3.  

How on earth do I do this? cols="???"

Is there either a client-side solution in HTML or Javascript, or will
I have to use a server-side solution in PHP? I'm completely stuck and
under a Monday AM deadline to come up with a solution.

Thanx
Phil


instead of using: cols="???"
try using: style="width:100%;"
Jul 23 '05 #3
for sure, agree with "style='width:100%'"

--
www.vicdir.com
"neur0maniak" <us****@neur0maniak.co.uk> ????
news:40***********************@ptn-nntp-reader02.plus.net...
Phil Powell wrote:
The customer made a wild request: they want on their admin panel a
textarea that will display an existing resume.

This textarea, however, must have a dynamic width, one that "fills the
screen width of any sized screen". Sorry but I cannot fathom how to
do this!

Expand|Select|Wrap|Line Numbers
  1.  > <textarea name="resume" cols="108" rows="29" wrap="physical><?=
  2.  > $resume ?></textarea>
  3.  > 

How on earth do I do this? cols="???"

Is there either a client-side solution in HTML or Javascript, or will
I have to use a server-side solution in PHP? I'm completely stuck and
under a Monday AM deadline to come up with a solution.

Thanx
Phil


instead of using: cols="???"
try using: style="width:100%;"

Jul 23 '05 #4
"neur0maniak" <us****@neur0maniak.co.uk> wrote in message
news:40***********************@ptn-nntp-reader02.plus.net...
Phil Powell wrote:
This textarea, however, must have a dynamic width, one that "fills the
screen width of any sized screen". Sorry but I cannot fathom how to
do this!


instead of using: cols="???"
try using: style="width:100%;"


Actually, cols is a required attribute of a textarea. You must provide a
value, but using 'style="width: 100%;"' will override the cols setting for
the width of the textarea.

Chris Finke
Jul 23 '05 #5
Eric B. Bednarz <be*****@fahr-zur-hoelle.org> wrote in message news:<m3************@email.bednarz.nl>...
so*****@erols.com (Phil Powell) writes:
This textarea, however, must have a dynamic width, one that "fills the
screen width of any sized screen". Sorry but I cannot fathom how to
do this!


textarea
{
width: 100%;
}
Follow-up set. See also:

<http://www.cs.tut.fi/~jkorpela/usenet/laws.html#law7>

Completely failed in Mozilla Firefox 0.6, produces a textarea with "no
width" whatsoever (it looks like a super-skinny textarea).

Phil
Jul 23 '05 #6
neur0maniak <us****@neur0maniak.co.uk> wrote in message news:<40***********************@ptn-nntp-reader02.plus.net>...
Phil Powell wrote:
The customer made a wild request: they want on their admin panel a
textarea that will display an existing resume.

This textarea, however, must have a dynamic width, one that "fills the
screen width of any sized screen". Sorry but I cannot fathom how to
do this!

Expand|Select|Wrap|Line Numbers
  1.  > <textarea name="resume" cols="108" rows="29" wrap="physical><?=
  2.  > $resume ?></textarea>
  3.  > 

How on earth do I do this? cols="???"

Is there either a client-side solution in HTML or Javascript, or will
I have to use a server-side solution in PHP? I'm completely stuck and
under a Monday AM deadline to come up with a solution.

Thanx
Phil


instead of using: cols="???"
try using: style="width:100%;"

Sorry that totally failed in Mozilla Firefox 0.6, only showing a
"super skinny no-width textarea".

Phil
Jul 23 '05 #7
"Christopher Finke" <ch***@efinke.com> wrote in message news:<2l************@uni-berlin.de>...
"neur0maniak" <us****@neur0maniak.co.uk> wrote in message
news:40***********************@ptn-nntp-reader02.plus.net...
Phil Powell wrote:
This textarea, however, must have a dynamic width, one that "fills the
screen width of any sized screen". Sorry but I cannot fathom how to
do this!


instead of using: cols="???"
try using: style="width:100%;"


Actually, cols is a required attribute of a textarea. You must provide a
value, but using 'style="width: 100%;"' will override the cols setting for
the width of the textarea.

Chris Finke


Following was what I attempted, with horrific failure:

[SCRIPT]
<script type="text/javascript">
<!--

function getWinWidth() {
var isNav = (document.all) ? false : true;
var isIE = (document.all) ? true : false;
if (isNav && !isIE)
return(window.innerWidth);
else if (isIE && !isNav)
return(document.body.clientWidth);
else
return(null);
}

var width = getWinWidth() / 4;
document.writeln('<textarea rows="29" name="resume" cols="' +
width + '">');
//-->
</script>
<noscript>
<textarea rows="29" name="resume" cols="120" style="{width:
100%}">
blah blah blah this is my resume
</textarea>
</noscript>

[/SCRIPT]

What results is that you will see a textarea with someone's resume and
you will also physically see the <noscript> and <textarea> tags INSIDE
the textarea!

Phil
Jul 23 '05 #8
(followups trimmed to ciwah only)

so*****@erols.com (Phil Powell) writes:
The customer made a wild request: they want on their admin panel a
textarea that will display an existing resume.
Does it actually have to be a textarea? If the content doesn't need to
be edited then resubmitted you could fake it with <pre> and some
stylesheets. Otherwise, though:
This textarea, however, must have a dynamic width, one that "fills the
screen width of any sized screen". Sorry but I cannot fathom how to
do this!
Not reliably possible. Probably not desirable in all circumstances
either. Consider when the browser window is narrower than the screen
width. Even assuming they meant canvas width, on a really wide screen
this is going to look silly and possibly do strange things with line
wrapping.
<textarea name="resume" cols="108" rows="29" wrap="physical><?= ^
missing closing quote?
Is there either a client-side solution in HTML or Javascript, or
will I have to use a server-side solution in PHP? I'm completely
stuck and under a Monday AM deadline to come up with a solution.


Tell them it's not possible [1,2] and just put in a large (cols="80"?)
textarea.

[1] Silly Alternative 1: If you're given enough time (years) and
funding (thousands, millions, etc) you could get the next versions of
every browser to support the CSS trick you were shown, I suppose.

[2] Silly Alternative 2: Say that w3m is your only supported
browser. It opens an external editing program for textareas, which
gets around this problem.

--
Chris
Jul 23 '05 #9
Phil Powell wrote:
Following was what I attempted, with horrific failure:

[SCRIPT]
<script type="text/javascript">
<!--

function getWinWidth() {
var isNav = (document.all) ? false : true;
var isIE = (document.all) ? true : false;
if (isNav && !isIE)
return(window.innerWidth);
else if (isIE && !isNav)
return(document.body.clientWidth);


[snip]

This looks all too complicated. What are you trying to do with it? Why
are you querying the window width?

I didn't try to figure it all out. But did you try the css solution
without the js? I've sucessfully adjusted the width of a <textarea>
using css.

This has nothing to do with HTML that I can see, and nothing to do
with PHP. You've cross-posted to so many groups, I don't know which
one you normally read. Please trim x-posting, and set followups. There
is no need to add noise to groups where this post is off-topic.

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 23 '05 #10
You have had the best solution yet!!!! :)

I'll talk to the client and tell them that, due to technological
limitations (I can be that vague they are way not savvy!) textareas must
have a fixed width and that's that.

Phil

---------------------------------------
TCL and PHP: The Superior Web Languages!
javascript: Is Cool
ASP: why?
http://valsignalandet.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #11
Actually I wasn't sure where to post this because I didn't know if the
solution were a client-based solution with HTML, a client-based solution
with Javascript, or a server-based solution with PHP, therefore, I had
no choice. I was not sure how this problem could be solved without
posting to the "wrong group" altogether, so I covered my bases that way.

I also tried the CSS solution of adding style to the textarea, but it
wound up "busting through" the table and being the size of the screen,
not the resolution size or even the size of the table itself.
Furthermore, the <noscript> and <textarea> tags appeared INSIDE the
textarea itself upon doing so!

Phil

---------------------------------------
TCL and PHP: The Superior Web Languages!
javascript: Is Cool
ASP: why?
http://valsignalandet.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #12
actually you dont need javascript at all in this case.

--
www.vicdir.com
"The Nordic One" <de*********************@null.com> ????
news:40**********************@news.newsgroups.ws.. .
Actually I wasn't sure where to post this because I didn't know if the
solution were a client-based solution with HTML, a client-based solution
with Javascript, or a server-based solution with PHP, therefore, I had
no choice. I was not sure how this problem could be solved without
posting to the "wrong group" altogether, so I covered my bases that way.

I also tried the CSS solution of adding style to the textarea, but it
wound up "busting through" the table and being the size of the screen,
not the resolution size or even the size of the table itself.
Furthermore, the <noscript> and <textarea> tags appeared INSIDE the
textarea itself upon doing so!

Phil

---------------------------------------
TCL and PHP: The Superior Web Languages!
javascript: Is Cool
ASP: why?
http://valsignalandet.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 23 '05 #13
Phil Powell wrote:
Eric B. Bednarz <be*****@fahr-zur-hoelle.org> wrote in message news:<m3************@email.bednarz.nl>...


Please do not write attribution novels. Duplicating header information
other than the name of the previous poster(s) serves no greater good but
instead makes discussions less legible.
so*****@erols.com (Phil Powell) writes:
This textarea, however, must have a dynamic width, one that "fills the
screen width of any sized screen". Sorry but I cannot fathom how to
do this!


textarea
{
width: 100%;
}
Follow-up set. See also:

<http://www.cs.tut.fi/~jkorpela/usenet/laws.html#law7>


Completely failed in Mozilla Firefox 0.6, produces a textarea with "no
width" whatsoever (it looks like a super-skinny textarea).


Always W('d)FM, so you should post the relevant snippet along with
the exact Firefox version you have tested with (see Help, About ...;
0.9.x is current, BTW) to the *one* right newsgroup.

And have you even understood the document the above URL refers to?
Please learn how to avoid crossposting as Google Groups is incapable
of obeying Followup-To (i.e. setting the target newsgroup to the one
that was specified in the Followup-To header of the posting one
replies to). Or simply use newsreader software which allows you to
get rid of the other Google Groups' flaws. I recommend Mozilla
Thunderbird, see <http://www.mozilla.org/products/thunderbird/>.
Removed alt.* from the crosspost (do not crosspost over main
hierarchies!), X-Post & F'up2 comp.infosystems.www.authoring.stylesheets

PointedEars
Jul 23 '05 #14
Phil Powell wrote:
"Christopher Finke" <ch***@efinke.com> wrote [...]:
"neur0maniak" <us****@neur0maniak.co.uk> wrote [...]:
instead of using: cols="???"
try using: style="width:100%;"
Actually, cols is a required attribute of a textarea. You must provide a
value, but using 'style="width: 100%;"' will override the cols setting for
the width of the textarea.
[...]


Following was what I attempted, with horrific failure:


Which does not make me wonder why.
<script type="text/javascript">
OK.
<!--
Obsolete.
function getWinWidth() {
var isNav = (document.all) ? false : true;
var isIE = (document.all) ? true : false;
if (isNav && !isIE)
return(window.innerWidth);
else if (isIE && !isNav)
return(document.body.clientWidth);
else
return(null);
}
Nonsense. Test exactly for the properties you want to use, not
something else: <http://pointedears.de/scripts/test/whatami>
var width = getWinWidth() / 4;
Not required. Use CSS.
document.writeln('<textarea rows="29" name="resume" cols="' +
width + '">');
The "textarea" element requires a close tag which is missing here.
If you would include it, you would be required to escape the ETAGO
delimiter "</": "<\/".
//-->
Obsolete.
</script>
<noscript>
<textarea rows="29" name="resume" cols="120"
style="{width:100%}"> ^ ^ blah blah blah this is my resume
</textarea>
</noscript>
You do not require scripting, so you do not require the "noscript"
element. But if you would, the "style" attribute's syntax would
have not been matched. You may want to learn about style sheets,
among other things.
What results is that you will see a textarea with someone's resume and
you will also physically see the <noscript> and <textarea> tags INSIDE
the textarea!


BAD. Borken as designed.
Removed alt.* from the crosspost,
X-Post & F'up2 comp.infosystems.www.authoring.misc

PointedEars
Jul 23 '05 #15
The Nordic One wrote:
You have had the best solution yet!!!! :)
No. And your Exclamation Mark Key is borken. [psf 2.3]
I'll talk to the client and tell them that, due to technological
limitations (I can be that vague they are way not savvy!) textareas
must have a fixed width and that's that.


This is utter nonsense.
PointedEars
Jul 23 '05 #16
JRS: In article <Rt********************@comcast.com>, dated Sat, 24 Jul
2004 12:04:44, seen in news:comp.infosystems.www.authoring.stylesheets,
Randy Webb <Hi************@aol.com> posted :
In a message inscribed upon the eternal scroll know as Usenet, Thomas
'PointedEars' Lahn wrote diligently about the abstract ideas of
attribution lines:
Phil Powell wrote:
Eric B. Bednarz <be*****@fahr-zur-hoelle.org> wrote in message news:<m3eknbmtk

3.***@email.bednarz.nl>...


Please do not write attribution novels. Duplicating header information
other than the name of the previous poster(s) serves no greater good but
instead makes discussions less legible.


It seems ironic that you waste more time/space complaining about
attributions than the attributions take up. And to top it off, your
argument is utter nonsense.

<--snip-->

Removed alt.* from the crosspost (do not crosspost over main
hierarchies!), X-Post & F'up2 comp.infosystems.www.authoring.stylesheets


To date, that is the dumbest thing I have seen you write. If the source
of a problem is not known, and it is possible it may have several
different possible solutions, then crossposting is the *correct* thing
to do, as compared to multi-posting.


*Note* FU was set; it was to a group that contains currently (9 days) no
articles by him, so one should not assume that he reads it.
The following show current expert thinking :
http://www.ietf.org/internet-drafts/...article-13.txt
http://www.ietf.org/internet-drafts/...-useage-00.txt
and IMHO should be quoted when answering the buffoon.

They consider Lahnish attributions inadequate, and permit my style.

They say nothing against cross-posting cross-hierarchy, although one can
see where that, if wanted, should appear.

<FAQENTRY> Don't post merely to criticise spelling.

INFO: While this is not an HTML group, javascript can write HTML. The
combination of all three of MSIE4, dates YYYY-MM-DD, and justification
can lead to undesirable character spacing. YYYY/MM/DD is OK.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> JL / RC : FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #17

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

Similar topics

12
by: Phil Powell | last post by:
The customer made a wild request: they want on their admin panel a textarea that will display an existing resume. This textarea, however, must have a dynamic width, one that "fills the screen...
4
by: dmiller23462 | last post by:
I'm trying to create a submission page for users to request PC/LAN Access....If they select "Yes" in the field asking about if they need Non Standard Software, I want several other HTML fields to...
19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
1
by: since | last post by:
I figured I would post my solution to the following. Resizable column tables. Search and replace values in a table. (IE only) Scrollable tables. Sortable tables. It is based on a lot...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.