Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert IWEdit1.text to Uppercase
#1
Hi All,

In an IWEdit field, I need the input to be in uppercase chars. 

I'm currently doing it as part of the SQL insert command, where each NVarChar field is converted with ".toupper", so that the saved value is correct. It also means I can search for the value, even with lowercase chars.

However, I would like to do it, char by char, while the user is typing.

I am already looking a each keydown for the fields in question, in combination with searches.

Is it possible to do the conversion between the keydown event is fired, and the pressed key is shown in the edit field ? That way it would be transparent for the user.

Is there an easy way of doing it and it, how is it done ?

Regards
Soren
Reply
#2
Hi Soren. If i understand, you can put in your IWEdit->ScriptEvents->onKeyUp:
Code:
this.value = this.value.toUpperCase();
return true;
Reply
#3
Hi Jose,

Thanks. I have tried something like that before, but not the way you specify it, and also, not been observing the case sensitive function names.

It is working quite nicely, and in fact it works just with:

this.value = this.value.toUpperCase()

No return true, and no ; at the end of the this.value line.

And it look nice too. You just very shortly see the lowercase char in the field being replaced by the capital char. Very nice.

Again thanks for the quick reply.

Regards
Soren
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)