|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Firefox problem
Hi,
I've written this function to automatically change input to upper case, it works in IE but not firefox can anyone help? Code:
function upper(){
var result=window.event.keyCode;
var resultChar = String.fromCharCode(result);
resultChar = resultChar.toUpperCase();
frmMember.postcode.value += resultChar;
return false;
}
|
|
#2
|
|||
|
|||
|
Why do you want to do it like that?
It is much more easier to convert it on submittal of the form, or when your script accepts the form... |
|
#3
|
|||
|
|||
|
I've actually managed to sort it but the reason is, I need to check each key stroke for certain combinations i.e if the user types 'BFP' a check box is automatically checked etc and on submit the results are concatenated depending on the outcome. It's simpler for the user if it's done in real time rather than having to click submit over and over
|
|
#4
|
||||
|
||||
|
keypress vs onsubmit
You do not need to test every keypress. You can test for "in string" and process the form's data "on submit" so that
Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Firefox problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|