on 05-21-2014 9:34 PM
I've looked in the SAPUI5 API Reference and I googled for this but there's no info on how to implement pattern. Though my Input is set to type Number, it's allowing the user to enter '@', '&'.
Is there any way to implement pattern for this Input object? Thanks.
Hi Jay,
This can be done as follows,
var seatNumber = new sap.m.Input( { value : "Some Dummy Value",
type : sap.m.InputType.Number } )
Now, this sap.m.Input will accept only numbers.
Happy coding.
Regards,
Suraj Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can enforce an integer or float type input using type system. Please refer to OpenUI5 SDK - Demo Kit . Working example here Data binding test page with Data Types
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this,
var app = new sap.m.Input("Input");
var oButton1 = new sap.ui.commons.Button({
text : "Button",
press : function() {
//Allow only alphanumeric characters
var mailregex = /^[a-zA-Z0-9]*$/;
if (!app.getValue().match(mailregex)) {
alert('Special Characters : ' + app.getValue() + ' not allowed ');
}
}
});
// attach it to some element in the page
app.placeAt('content');
oButton1.placeAt("content");
Thanks,
S.Rajkumar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.