Please help me!

Results 1 to 3 of 3

Thread: Please help me!

  1. #1
    Join Date
    Dec 1969

    Default Please help me!

    I've got three textboxes - price, tax and total. When the user inputs the price and tabs on to the tax box, I need 17.5% of the price to automatically appear in the tax box. Then, when the user tabs on to the total box, I want to be able to make the sum of the price and tax automatically appear in the total box.

  2. #2
    Kasper Guest

    Default Not extremely difficult

    No need for asp though, just use javascript.<BR><BR>Testcase : form name = theForm<BR>textboxes named price, tax and total<BR><BR>put an onBlur event in your price element<BR>e.g. &#060;input type=&#039;text&#039; name=&#039;price&#039; onBlur=&#039; .value=this.value*0.175;&#039;&#062;<BR>I assume you can figure out the &#039;total&#039;-routine for yourself.<BR>Didn&#039;t test the code, so may contain little bug, but idea should be the same though :)

  3. #3
    Join Date
    Dec 1969

    Default RE: Not extremely difficult

    Thanks, for that, but I&#039;m getting &#039;Nan&#039; instead of the total up...don&#039;t suppose you could tell me why??<BR><BR>function calcTotal()<BR> <BR> {<BR> price = parseInt("purchaseCars3.car_price.value");<BR> vat = parseInt("purchaseCars3.car_vat.value");<BR> total = parseInt("price + vat");<BR> purchaseCars3.car_total.value = total<BR> }<BR>Cheers!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts