Skip to main content

Hello All

 

There is one requirement that if a control is selected ;ike textbox then the control should highlight with some background color.
This is the behaviour generally we see in SAP where we select some fields to enter then that control is highlighted.
I tried to write in conditional styles on text box but iam not successfull.
Can someone suggest how can we achieve this?

 

Hi Jalligama

 

There is no way to change a controls background colour using rules or conditional styles as SmartForms do not have a Focus event for controls.

 

I suggest you look at modifying the Theme (CSS) you are using to modify the focus style for controls. If you are not familiar with K2 Themes then have a look at the K2 SmartForms Developer Guide

 

As an example, I changed the following entry for the SharePoint 2013 theme (CSS file):

 

.theme-entry .SFC.SourceCode-Forms-Controls-Web-TextBox.focus,

 

and set the background colour to green (background: #40FF00;), which resulted in the textbox having a green background when I click into it (reverts back to normal when I click out)

 

Alternatively you could insert some javascript into your form to try and do the same thing (see

http://www.aspsnippets.com/Articles/Change-TextBox-Background-color-on-Focus-using-JavaScript-jQuery-CSS.aspx)

 

 


Reply