Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Questions related to using nuBuilder Forte.
-
joecocs
- Posts: 67
- Joined: Wed Jul 04, 2018 4:11 pm
- Location: France
Unread post
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.

-
toms
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Unread post
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.
You do not have the required permissions to view the files attached to this post.
-
joecocs
- Posts: 67
- Joined: Wed Jul 04, 2018 4:11 pm
- Location: France
Unread post
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 ?
-
toms
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Unread post
by toms »
Try this:
Code: Select all
$('#nubody').css("background-color", "red");
Or:
Code: Select all
$('#nuRECORD').css("background-color", "red");
-
joecocs
- Posts: 67
- Joined: Wed Jul 04, 2018 4:11 pm
- Location: France
Unread post
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
-
toms
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Unread post
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)
-
joecocs
- Posts: 67
- Joined: Wed Jul 04, 2018 4:11 pm
- Location: France
Unread post
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