![]() |
| |||
| You will just have to do a ParseInt function on the text field variable to get the number value. and then you can peform any mathematical operation using javascript. The below link has an example and code similar to what you are after |
| |||
| Save this in a File say ABC.html and then Open. <HTML> <Head> <Style> #NB { border-style=none; border=0px; } </Style> <Script> function Calculate() { Q=eval(document.frm.txtQty.value); P=eval(document.frm.txtPrice.value); document.frm.txtResult.value= "Result is " + (Q*P); } </Script> </Head> <Body> <Form Name=frm> <Pre> Enter Quantity : <Input Type=Text name=txtQty Value=0 MaxLength=5 onKeyUp=Calculate()><Br> Enter Price : <Input type=Text Name=txtPrice Value=0 Maxlength=5 onKeyUp=Calculate()><Br><Br> <Input Type=Text Name=txtResult ID=NB> </pre> </Form> </Body> </HTML> |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| <MYSQL, phpmyadmin NOOB> How do i make a field in mysql that can contain more than one data? | kbharath | PHP | 1 | 04-25-2007 07:00 PM |
| Text input box | _soularis | JavaScript | 4 | 03-28-2007 08:09 PM |
| How do I extract files in Plesk cpanel? | Zatoichi | Web Hosting | 2 | 12-17-2006 12:13 PM |
| PHP - saving results from new array entry - PHP ? | dejan99 | PHP | 2 | 11-24-2006 08:39 PM |
| how do I enter HTML/DHTML or CSS in any text field from a scanned image? | vijay | Webdesign & HMTL | 2 | 03-24-2006 03:11 PM |