Two javascript functions not called when return type function is first called

Ho.Com.Sa

New Member
I need to call 2 functions onkeypress out of which first function is return type; and second function is not getting calledbut if use in reverse order it is workingRequirement: \[quote\] OnKeyPress, the key should be validated. if number, accept the value in TextBox then copy the value into another textbox; If not a number, then do nothing\[/quote\]Correct Order but 2nd function is not getting called;\[code\]<input type="text" name="no_of_units" id="no_of_units" size="5" onkeypress="return isNumberKey(event);calc_exchange();">\[/code\]In Reverse order both functions are working. I need the isNumberKey function to be called first.\[code\]<input type="text" name="no_of_units" id="no_of_units" size="5" onkeypress="calc_exchange();return isNumberKey(event);"\[/code\]Functions :\[code\]function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; }function calc_exchange(){var raw1=document.getElementById("no_of_units").value;document.getElementById("next_no_of_units").value=http://stackoverflow.com/questions/14424713/raw1;}\[/code\]I need the following order of function to be called;\[quote\] [*]return isNumberKey(event) [*]calc_exchange() \[/quote\]
 
Back
Top