jQWidgets Forums
jQuery UI Widgets › Forums › Editors › Input, Password Input, TextArea, ColorPicker, Rating, TagCloud, Loader › Autocomplete Font Color
Tagged: font color, Input, jqxinput
This topic contains 3 replies, has 2 voices, and was last updated by Nadezhda 10 years, 5 months ago.
-
AuthorAutocomplete Font Color Posts
-
Hello, how to change the color of the options shown in the auto complete field ? Please help, thank you.
Hello C.S.Putera,
You can change the font color with css or just set some JQWidgets’ theme. Here is an example which shows how to change font color via css:
<!DOCTYPE html> <html lang="en"> <head> <title></title> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="../../scripts/demos.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxinput.js"></script> <style> .jqx-widget-content { color: red; } </style> <script type="text/javascript"> $(document).ready(function () { var timer; $("#input").jqxInput({ placeHolder: "Enter a City", height: 25, width: 200, source: function (query, response) { var dataAdapter = new $.jqx.dataAdapter ( { datatype: "jsonp", datafields: [ { name: 'countryName' }, { name: 'name' }, { name: 'population', type: 'float' }, { name: 'continentCode' }, { name: 'adminName1' } ], url: "http://api.geonames.org/searchJSON", data: { featureClass: "P", style: "full", maxRows: 12, username: "jqwidgets" } }, { autoBind: true, formatData: function (data) { data.name_startsWith = query; return data; }, loadComplete: function (data) { if (data.geonames.length > 0) { response($.map(data.geonames, function (item) { return { label: item.name + (item.adminName1 ? ", " + item.adminName1 : "") + ", " + item.countryName, value: item.name } })); } } } ); } }); }); </script> </head> <body class='default'> <input type="text" id="input" /> </body> </html>
Best Regards,
NadezhdajQWidgets team
http://www.jqwidgets.com/Thank you for your response. I’ve tried adding the css :
<style> .jqx-widget-content { color: red; } </style>
It changes the font ‘within’ the jqwidgets field, but when I populate the options from the autocomplete, the options still in blue color. What I want to achieve is to set the color of the fonts in the options to black. Any other way to achieve that ? Thank you.
Hi C.S.Putera,
Please, provide us with more information or a sample code.
Best Regards,
NadezhdajQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.