Hi,
I am trying to create a text field that only takes numeric by using a regular _expression_ to replace anything that is not a digit with null. The regular _expression_ works. However, the QxTextFiled.setValue() does not seem to worl all the way.
1. If the value entered is 1a2 then the value being displayed is "12". However, if the value is "abc" then the display value is "abc" eventhough "match" is null.
2. Also, with "valueField.setSelectable(true)", I can select a text field with double click but can not just drag and select.
Please help me to see what I have done wrong. Here is the codesnipets.
Thank you very much in advance.
var valueField = null;
valueField = new QxTextField(value);
valueField = new QxTextField(value);
valueField.setSelectable(true);
valueField.addEventListener("input", function(e) {
var re = /[^\d]/g
var text = e.getData();
var match = text.replace(re,"");
valueField.setValue(match);
QxWidget.flushGlobalQueues();
}, this );
var re = /[^\d]/g
var text = e.getData();
var match = text.replace(re,"");
valueField.setValue(match);
QxWidget.flushGlobalQueues();
}, this );
th_java
On Yahoo!7
360°: Your own space to share what you want with who you want!
_______________________________________________ Qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
