Page 1 of 2

Color of forms

Posted: Fri Jul 06, 2018 11:56 am
by joecocs
Hello,
In my app I have several sub-forms and for clarity I want to put a color to each form. ;)

I tried to assign a style in JScript to each form, but it does not work because I do not understand the syntax. :?

I am a newbee in JScript and Nubuilder !!!

Thanx for your help. :)

Re: Color of forms

Posted: Fri Jul 06, 2018 12:03 pm
by toms
Hi,

Here's an example:
To set a different background color, place this code in your mainform's JavaScript field:

Code: Select all

if (nuFormType() == 'edit') {
  $('#ID_of_your_subform').css("background-color", "red");
}

Replace ID_of_your_subform with the ID of your subform.

Re: Color of forms

Posted: Fri Jul 06, 2018 12:18 pm
by joecocs
toms wrote:Hi,

Here's an example:
To set a different background color, place this code in your mainform's JavaScript field:

Code: Select all

if (nuFormType() == 'edit') {
  $('#ID_of_your_subform').css("background-color", "red");
}
Replace ID_of_your_subform with the ID of your subform.
Thank you for your quick response,
that I arrived there,
but is there not a syntax to change the color of the current form or TAB ?

Re: Color of forms

Posted: Fri Jul 06, 2018 1:30 pm
by toms
Try this:

Code: Select all

  $('#nubody').css("background-color", "red");
Or:

Code: Select all

  $('#nuRECORD').css("background-color", "red");

Re: Color of forms

Posted: Tue Jul 10, 2018 12:59 am
by admin
.

Re: Color of forms

Posted: Sat Jul 14, 2018 12:19 pm
by joecocs
Nice !

I use it
Just one detail for a subform in subform in form this is in normal color.?!?

If you have a solution for change its colour

Thank you

Re: Color of forms

Posted: Mon Jul 16, 2018 11:42 am
by toms
Something like this:

Code: Select all

$(window.parent.document).find('#ID_OF_THE_SUBFORM_OBJECT').contents().find('#nuRECORD').css('background-color','red');
(Replace ID_OF_THE_SUBFORM_OBJECT with the subform object id)

Re: Color of forms

Posted: Wed Jul 18, 2018 8:10 pm
by admin
.

Re: Color of forms

Posted: Tue Jul 31, 2018 3:04 pm
by joecocs
Hello, thank you for your help.
toms wrote:Something like this:

Code: Select all

$(window.parent.document).find('#ID_OF_THE_SUBFORM_OBJECT').contents().find('#nuRECORD').css('background-color','red');
(Replace ID_OF_THE_SUBFORM_OBJECT with the subform object id)
I don't understand where i write this (in form, in sub-form or in record of sub-form ?)

see you soon

Re: Color of forms

Posted: Thu Aug 02, 2018 12:07 am
by admin
joecocs,

If you place this inside the Javascript section of the main Edit Form...

Code: Select all

$(window.parent.document).find('#thesubform').contents().find("[id$='nuRECORD']").css('background-color','red');
it should work.
https://wiki.nubuilder.cloud/ ... Javascript

Steven