1

I am using extjs 4.2 and I want to highlight the required fields in yellow.

This i can do like this

.x-form-required-field {

background-color:yellow;

}

But what i also want is that if that field is filled then system should remove the highlight

i am not able to do that. can anyone please help me on this

user1994660
  • 5,253
  • 11
  • 30
  • 33
  • This post helped me to achieve something similar.(I prefer a simple asterisk) http://stackoverflow.com/questions/7950375/extjs-4-mark-a-red-asterisk-on-an-required-field – code4jhon May 19 '14 at 03:03
  • @code4jhon actually i have that but problem is i want to highlight fields , in big form its diffcult to find stars to see whicgh feilds are required. if input box is highlighted then its easy to spot – user1994660 May 19 '14 at 03:23
  • You can find required fields by calling `form.query('field[allowBlank=false]')`. It returns an array that you can iterate. – Saki May 19 '14 at 06:16

1 Answers1

2

If you have set emptyText config, then emptyCls config can be used

Sample fiddle: https://fiddle.sencha.com/#fiddle/5uq

Community
  • 1
  • 1
newmount
  • 1,921
  • 1
  • 12
  • 10