From: M.L. on


>> >> 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.
>>
>> I'd prefer handling a single sheet "when possible." I expect a
>> multi-page invoice on rare occasions though.
>>
>> >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?
>>
>> I was focusing on paper printing.
>
>So the question remains, how can you print on one sheet a text
>box that has been filled in by someone with more text than a
>printing sheet could possibly hold?

It's not necessary for everything to fit on one page. Nor do I expect
the invoice will be a single page for everybody. However, for most
customers I expect one page to be enough. If the invoice overflows one
printed page, the printer can handle it.
From: M.L. on


>> 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.
>[...]
>> 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."
>
>So in other words there is no server, and no form to submit? In that
>case have a normal textarea and a button (called something like
>"format") to press when you're finished typing.

Exactly. I've already incorporated the ideas presented here except for
a re-editing feature that you mention below. The invoice opens each
line with a 5 row textarea. When I click the button that calculates
the subtotal, discount, sales tax, shipping and total, I also convert
the textarea into a innerHtml text cell. My DHTML invoice works fine
now.

>The button's handler, in Javascript, gets the text out of the textarea
>and puts it into a div instead, which is also switches to display:
>block. It then makes the textarea display: none and the div display:
>block.
>
>You can have another button (called "edit" perhaps) to swap the div back
>with the textarea if you decide you want to edit the text again.

I might incorporate that idea later. For now, each dynamically added
row contains a textarea. The user can edit any rows while they are in
textarea format. After pressing a button to convert all textareas to
plain text cells, only the last row can be edited by deleting it then
adding a new row with textarea.

>The edit button should be disabled and the format button enabled when
>the textarea is displayed, and vice versa when the div is displayed.

>Effectively you will have a Web-2.0 non-wysiwyg word processor.
>
>> 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.
>
>Another way to do it is present all the text on the page as text
>(non-existent initially), but when you click in a table cell or press
>some button in it, a div pops up containing a textarea and an "OK
>button. You fill in the textarea, press "OK" and it go away and dumps
>the text in where you where. This way you can make the textarea nice and
>big if you have a lot of places on the page where text needs to be
>inserted.

I'm keeping all those features in mind when I decide to add
post-textarea line editing.
From: Jeff Thies on
M.L. wrote:
>
>>> 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,
>> It is.
>>
>> <textarea id="my_textarea"></textarea>
>>
>> <div id="my_textarea_display"></div>
>>
>> If this is just for printing:
>>
>> 1) Read the value of my_textarea
>> 2) Set the innerHTML of my_textarea_display to that value
>> 3) Set the display of my_textarea to: none
>>
>> Those are all easy things to do, Google if you don't know. Then ask.
>>
>> It's not hard to make an expanding textarea, but it is hard to calculate
>> how much is enough, and not too little.
>>
>> Jeff
>
> After a few deviations I finally got it to work. And it does so
> perfectly. My current markup uses an INPUT tag textbox but it'll be
> simple to change it to a textarea. Thank you so much for your
> Javascript assistance.

You did it yourself, congratulations. Ben and myself just pointed you
in the direction!

Jeff
From: Dr J R Stockton on
In comp.infosystems.www.authoring.stylesheets message <dorayme-
542AFC.13585602052010(a)news.albasani.net>, Sun, 2 May 2010 13:58:56,
dorayme <dorayme(a)optusnet.com.au> posted:
>
>So the question remains, how can you print on one sheet a text
>box that has been filled in by someone with more text than a
>printing sheet could possibly hold?

With an A3 Postscript landscape printer, it is quite easy to print a
long portrait document as what would be the result of writing the first
page on the left half of a landscape sheet of A3, then rotate the sheet
90 degrees left and print the second page root(0.5) smaller than that on
the left half of what is left, then rotate the sheet 90 degrees left and
print the third page root(0.5) smaller than that on the left half of
what is left, then rotate ...

Legibility does suffer after a few pages, though.

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 7.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
MiniTrue is good for viewing/searching/altering files, at a DOS / CMD prompt;
free, DOS/Win/UNIX, new via <URL:http://www.merlyn.demon.co.uk/pc-links.htm>.
From: David Stone on
In article <+rE+sPOzPy3LFwre(a)invalid.uk.co.demon.merlyn.invalid>,
Dr J R Stockton <reply1018(a)merlyn.demon.co.uk> wrote:

> In comp.infosystems.www.authoring.stylesheets message <dorayme-
> 542AFC.13585602052010(a)news.albasani.net>, Sun, 2 May 2010 13:58:56,
> dorayme <dorayme(a)optusnet.com.au> posted:
> >
> >So the question remains, how can you print on one sheet a text
> >box that has been filled in by someone with more text than a
> >printing sheet could possibly hold?
>
> With an A3 Postscript landscape printer, it is quite easy to print a
> long portrait document as what would be the result of writing the first
> page on the left half of a landscape sheet of A3, then rotate the sheet
> 90 degrees left and print the second page root(0.5) smaller than that on
> the left half of what is left, then rotate the sheet 90 degrees left and
> print the third page root(0.5) smaller than that on the left half of
> what is left, then rotate ...

Ah, the M C Escher option in the page/print setup dialog!

> Legibility does suffer after a few pages, though.

Indeed.