We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Input box appearance manipulation

Thread ID:





141599 Dec 20,2018 01:26 AM UTC Dec 21,2018 05:57 AM UTC ASP.NET MVC - EJ 2 3
Tags: Textbox
Asked On December 20, 2018 01:26 AM UTC

I created a text box where the placeholder moves out of the way when the text box gets focus:

     <input id="username" class="e-input">

Then in javascript file:

     var inputobj1 = new ej.inputs.TextBox({
        placeholder: 'Username',
        floatLabelType: 'Auto',

How can I change the colors and the fonts?  Are there other parameters for "ej.inputs.TextBox"?

Christopher Issac Sunder K [Syncfusion]
Replied On December 20, 2018 10:13 AM UTC

Hi Travis, 

Thank you for contacting Syncfusion support. 

We have validated your query in TextBox component. You can customize the input element’s font color and size by using cssClass property which is used to add the new class at root element of the input element. 
Please refer the below code snippet 

var inputobj1 = new ej.inputs.TextBox({ 
    placeholder: 'Username', 
    floatLabelType: 'Auto', 
    cssClass: 'newClass' 
.e-float-input.e-control-wrapper.newClass { 
     color: blue; 
     font-size: 18px; 
For you convenience, we have prepared simple MVC TextBox sample and get that sample in the below location, 

Please let us know if you need any further assistance. 


Replied On December 20, 2018 10:27 PM UTC

Hi Christo:

Thanks for the info, this is great.

Now how do I change the font and color of the placeholder as well as the color of the bottom border/line?

Attachment: pict_793062a7.zip

Prince Oliver [Syncfusion]
Replied On December 21, 2018 05:57 AM UTC

Hi Travis, 

Thank you for your update. 

To change the font and color of the placeholder and the color of the bottom border line, kindly override the following styles. 

    .e-float-input.e-control-wrapper.newClass:not(.e-error) input:focus ~ label.e-float-text { 
        color: rgba(10, 163, 0, 1); 
        font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    .e-float-input.e-control-wrapper.newClass:not(.e-input-group) .e-float-line::before, 
    .e-float-input.e-control-wrapper.newClass:not(.e-input-group) .e-float-line::after { 
        background: rgba(10, 163, 0, 1); 

We have attached the modified sample for your reference, please find the sample at the following location: http://www.syncfusion.com/downloads/support/forum/141599/ze/EJ2-MVC-TextBox-customization283595137  

Please let us know if you need any further assistance on this. 



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon