0

I'm using version 4.1.4

Is it possible to create a form having some fields with a background color ?

something like the next image. example form

Thanks Alejandro

AJM.MARTINEZ
  • 477
  • 2
  • 10

1 Answers1

0

I wanted to put an easy answer to this one. This works with 4.1 too.

$form->getElement('yourfield')
    ->js(true)
    ->closest('.atk-form-row-line')
    ->css(array('background'=>'red'));

Of course there are many ways and styling of the forms is described here:

romaninsh
  • 10,606
  • 4
  • 50
  • 70
  • Romans, thanks for your response. I've added that code but The background of the field doesn't change. If i inspect the source I see this " $.atk4(function(){ $('#sample_project_nuevotrabajo_form_fieldtest').closest('.atk-form-row-line').css({'background':'black'});" . I'm doing something wrong or missing something ? thanks again – AJM.MARTINEZ Jul 26 '12 at 18:08
  • No, that's correct. Oh, right since you are using 4.1 the class name would be different. Use inspector to find out the class. I think the element was `
    ` or `
    ` in there. It have been changed to `
    ` in 4.2
    – romaninsh Jul 29 '12 at 04:40
  • Romans you're right. I've found it $f->getElement('field')->js(true)->closest('.atk-field-line')->css(array('background'=>'#c6c3c3')); Very thanks – AJM.MARTINEZ Jul 30 '12 at 10:45