RE: REal time javascript calculation

Results 1 to 2 of 2

Thread: RE: REal time javascript calculation

  1. #1
    Join Date
    Dec 1969

    Default RE: REal time javascript calculation

    Hi, I'm attempting to calculate the value entered into a textfield on a webpage from a static value and display the output into another textfield immediately. I'm attempting to do the calculation onmousedown but its not working properly. Its giving me teh total a keystroke late. Are there any samples on how I can perform this calculation in real time without pressing a "calculate" button?

  2. #2
    Join Date
    Dec 1969

    Default onMouseDown???

    Don&#039;t you mean onKeyDown?<BR><BR>If so, that&#039;s the wrong event. Try onKeyUp, instead.<BR><BR>When you use onKeyDown, you are getting the key *before* the keystroke is added into the displayed value.<BR><BR>********************<BR><BR>I might ask you what you will now do if the user does a COPY/PASTE to plunk a new value into the field.<BR><BR>Have you considered simply using a timer even to do the operation every quarter second or so? Then even if the user erases characters or plays fun mouse games you get the update.<BR><BR>

Posting Permissions

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