I am currently trying to build an order form for small ads. My problem would be as follows:
The price will be calculated according to the number of lines the ad will contain. A line containing 26 characters. I have set up a div with the price in the upper right corner of the page. I would like to have the content of the div, the price, to change as the content of the textarea grows. For example at 26 chars, the price is 3,00, and the second they write an extra character, and arrive at 27, the price to change to 6,00.
Any help would be appreciated. Thank you very much.
Note: I am working in a CMS very similar to Typo3.
You would probably want to do this with Javascript – specifically, something listening to the
changeandkeyupevents.If you’re using jQuery, you can do this with the
.change()and.keyup()methods, respectively.