From: M.L. on


>> I created an HTML invoice form that works well except for the
>> area where I enter the item description. I'd like a CSS solution that
>> will allow my description column to autowrap and expand vertically as
>> I type within the cell. I'd like the entirety of my text to be visible
>> within that cell for printing.
>>
>> I expected this to be a Javascript issue, but was told in that
>> newsgroup that it could be done with CSS. So I'm hoping someone here
>> can help. Thanks.
>
>URL?

There is no URL because I never planned for the invoice form to be on
the Internet. I plan to use it locally from my flash drive when
needed. I'm simply looking for a way to have the description field
print in its entirety as I type.
From: M.L. on


>> I created an HTML invoice form that works well except for the
>> area where I enter the item description. I'd like a CSS solution that
>> will allow my description column to autowrap and expand vertically as
>> I type within the cell. I'd like the entirety of my text to be visible
>> within that cell for printing.
>>
>> I expected this to be a Javascript issue, but was told in that
>> newsgroup that it could be done with CSS. So I'm hoping someone here
>> can help. Thanks.
>
>I don't think you can do that without Javascript. If you do use
>Javascript you could use the keypress handler to append text to a
>normal-flow block. It will autowrap and expand vertically as the browser
>reflows it. You'll also need a bit more JS to copy the text into a real
>form element so it gets submitted.
>
>Then you'll probably want to rig up a caret. You'll also need delete,
>moving around, and selection. Writing a whole text editor in Javascript
>is rather a lot of work, and even then it sucks, because people won't be
>able to paste text into it.
>
>A simpler way to do this might be just to have an ordinary form but
>after it's submitted you give the user back a page that's more
>printer-friendly, with the text they entered all visible somewhere.

Thanks for your response. However, this invoice was designed for local
printing only. It won't be used on the Internet so no submitting for
server side processing will be needed.
From: Jukka K. Korpela on
M.L. wrote:

> There is no URL because I never planned for the invoice form to be on
> the Internet.

Which part of "www" in the group name did you fail to understand?

I'd suggest that you hire a consultant instead of posting poorly described
problems around Usenet.

Oh, and please keep using the same clueless "From" field until you have a
clue.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

From: M.L. on


>> I created an HTML invoice form that works well except for the
>> area where I enter the item description. I'd like a CSS solution that
>> will allow my description column to autowrap and expand vertically as
>> I type within the cell.
>
>That differs from the problem description you gave in comp.lang.javascript:
>"My problem is that the table's input form field only widens to about 75% of
>the column width.

I fixed the width problem so didn't include it here. The problem with
vertically and dynamically expanding a textbox remains.

>Even worse, when I print the form it only shows the text within the visible
>input area."

>That looks pretty much something you should handle with CSS.
>
>Your problem seems to be a moving target, and it's quite probable that
>neither of the descriptions matches your real problem. If you had just
>posted a URL, you might already have the correct answer to the right
>question.

There is no URL because the invoice will be used locally from my flash
drive and will never be on the Internet. Once I'm done filling out the
DHTML invoice it will be locally printed for the customer. I'm not
asking to fix my current DHTML. I'm asking for advice on implementing
a dynamic feature that does not exist on my current DHTML invoice.

>If you don't even know that CSS cannot do things _as the user types input
>data_, you must be rather confused.

Please keep in mind that I went to the Javascript newsgroup in the
first place, but was redirected here. Perhaps the person who
redirected me was confused.

> It's quite possible that your only
>_real_ problem that that textarea content may not get printed.
>
>After all, on screen, a textarea is scrollable as needed, and with CSS, you
>can make it as large as possible (given the other content on the page). This
>should not pose a problem to a user, as that's how millions of forms work on
>web pages - though most of them might have too small dimensions for
>textareas, but you need not imitate that.

Since the form will never be on the Internet, I need a way to
automatically wrap text and show the textbox or textarea text in its
entirety either as I type, or after I finished typing inside the cell.
I want the customer to be able to see the entire description on his
invoice. I'd like it to work the way an Excel cell works when one sets
"Autofit Row height" and "Wrap Text."

It's important that the invoice be kept to a single page when
possible, so I'd prefer not to use a large preset textarea on each
row.

I much prefer an HTML invoice to Excel because I'm able to dynamically
add invoice rows as needed to keep the printout length as small as
necessary. In addition, the DHTML won't automatically overwrite
today's date on the form whenever I reopen it (I'm aware of the Excel
workaround to that but it isn't completely satisfying).

>_Printing_ textarea content is problematic, and there's something you can do
>about that in CSS, but it's really the wrong approach. You should normally
>not expect a page with a form to be printable so that form input gets
>properly printed. Instead, your server-side form handler should echo back
>the user input as a web page which is easily printable. Typically, you would
>echo back a page that looks a like a well-formatted invoice form but with
>the data received presented as normal page content, not form fields.
>
>ObCSS: That way, the data can also be styled as desired, without all the
>oddities that CSS implementations have with form fields.
From: dorayme on
In article <5fiot5hkkddtfvra91dg0sgk5iigqcgvae(a)4ax.com>,
M.L. <me(a)privacy.invalid> wrote:

> It's important that the invoice be kept to a single page when
> possible, so I'd prefer not to use a large preset textarea on each
> row.

If this is in relation to printing, surely you are asking the
impossible? If the entries in the text area are very large, there
is no way - except on roll paper printers - that it could be
contained on one sheet. If you are talking the look on the
screen, why would a big text area make the page anything less
than a single page, albeit scrolling?

--
dorayme