Go4Expert (http://www.go4expert.com/)
-   JavaScript and AJAX (http://www.go4expert.com/forums/javascript/)
-   -   javascript - onblur()..... really need your help.. (http://www.go4expert.com/forums/javascript-onblur-help-t11259/)

hazrizal84 11Jun2008 06:41

javascript - onblur()..... really need your help..
hi..i really need help from those who can solve my prob..here there are:

<script language=javascript>
function isNumberKey(evt)
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 47 || charCode > 57))
return false;

return true;
<p>Please enter your answer or type ( / ) if you don't know the answer.<br>
Your answer may not contain both numbers and ( / ) sign.<br><br>
34 + 54 = <input type=text size="6" onkeypress="return isNumberKey(event)" onblur=""></p>
<p>123 + 76 = <input type=text size="6" name="T1" onkeypress="return isNumberKey(event)" onblur=""></p>
<input type=submit value="Check Answer!">

User will be able to key in their answer in numerical form or just type slash ( / ) for unknown answer..the prob is, how can i build up the function in onblur() statement so that, when tab button been pressed to move to the other textbox, it will determine whether user key in number, slash or the combination of number and slash. message box will be popped up if user key in both number and slash in the space provided.

shabbir 11Jun2008 12:57

Re: javascript - onblur()..... really need your help..
Moved from Java to JavaScript forum

All times are GMT +5.5. The time now is 22:42.