I would like to make a form in HTML where a user enters some data, and via JS that data is used to calculate results that are output to result fields in real time. By that I mean that say I enter Age (24) and Height (1.82m), a field will automatically display the result of 24 * 1.82 after the 1.82 is typed.
Also I would like to know how to output a web page as PDF.
First question :
This gets the values from 2 fields (
field1andfield2), multiplies them together and then updates thevalueof thetotalinput. Example HTML used with the above would be :the
onblurattribute calls the specified function (calc()) when theinputlooses focus. Note that this is a very simple example and contains no error checking (ie there is a number present etc)Second question :
For creating PDFs from HTML wkhtmltopdf is the best I have used – its simple to use and has lots of wrappers for different languages (server side – not client side). It runs as a standalone application too (on a server). Oh and its free !