Have a nice day,
I need to add a caption to each window. Is there an easy way to solve it?
Thank you for your ideas, Honz
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Headline or caption for browse window ?
Headline or caption for browse window ?
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Headline or caption for browse window ?
Add this JavaScript in a form's custom code:
If you declare the above function nuSetFormTitle() under Setup -> Header, it can be used in any form.
Code: Select all
function nuSetFormTitle(s, fs = 20){
s = escape(s);
$('#nuActionHolder').append("<span style='font-size:" + fs + "px; color:#54561d; vertical-align:middle;'>" + " ".repeat(15) + s + " </span>");
}
nuSetFormTitle('Hello nuBuilder ');
Re: Headline or caption for browse window ?
Hello ,
I am new to nubuilder ,javascript and php so please be patient !!!
I will surely have more questions.
I have tried this code in custom code of my form but the result is not what I expected ???
Also if I open in popup the text will not appear ??
Thank you
This is what I get.
Hello%20nuBuilder%20
I am new to nubuilder ,javascript and php so please be patient !!!
I will surely have more questions.

I have tried this code in custom code of my form but the result is not what I expected ???
Also if I open in popup the text will not appear ??
Thank you
Code: Select all
function nuSetFormTitle(s, fs = 20){
s = escape(s);
$('#nuActionHolder').append("<span style='font-size:" + fs + "px; color:#54561d; vertical-align:middle;'>" + " ".repeat(15) + s + " </span>");
}
nuSetFormTitle('Hello nuBuilder ');
Hello%20nuBuilder%20
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Headline or caption for browse window ?
The escape() function was missing:
Code: Select all
function escape(s) {
var escaped = {
'&': '&',
'<': '<',
'>': '>',
"'": ''',
'"': '"'
};
return s.replace(/[&<>'"]/g, function (m) {
return escaped[m];
});
}