on 10-19-2015 7:20 AM
Hi All,
We often get requirements from client where they want to highlight the placeholder of input field.
I have an input field. Its placeholder color has to be changed to 'RED' so that user understands that its a mandatory field.
Could you please help me out on how can i change this feature.
I have seen blog related to html5, but not sure in ui5 how to handle it.
Awaiting replies.
Thanks,
Zakeer
Hi Zakeerhusen,
will this help? http://jsbin.com/wemoze/edit?html,css,js,output
reference link : http://www.templatemonster.com/help/how-to-change-the-placeholder-text-color-of-an-input.html
Thanks,
Karthik A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
there are a few ways to do this.
Here they are
1. JS Bin - Collaborative JavaScript Debugging
2. JS Bin - Collaborative JavaScript Debugging
I prefer 2 because you can reuse the control in many places and have the same behavior
Thanks
-D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hallo Zakeer
You can use the value state function in SAPUI5.
Example:
Field must be numeric:
//View:
tfdPreCalibration = new sap.ui.commons.TextField({
id : "PreCalibration",
required : true,
change : function() {
if (this.getValue() === "") {
this.setValueState(sap.ui.core.ValueState.Error);//red
} else {
this.setValueState(sap.ui.core.ValueState.None);//normal
}
}
});
//Controller: (on submit)
var testPreCalibration = sap.ui.getCore().getControl("PreCalibration").getValue();
if ( ! sap.ui.controller(<mycontroller>).isNumberFieldValid(testPreCalibration) ){
sap.ui.getCore().getControl("PreCalibration").setValueState(sap.ui.core.ValueState.Error);
}
There is also a yellow warning state
Hope this helps
Antonette
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Zakeerhusen,
This is possible using custom CSS so you'll have to add your own html classes to the input fields where you want to have this effect.
Good luck!
Best regards,
Maarten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.