Hi,
I was thinking about label and textfield, can we get label on top and below to it text ??
for referrence i have included screenshot.
Regards,
Sandeep
Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Form lable on top and below text
-
- Posts: 41
- Joined: Thu Jan 25, 2018 3:51 pm
Form lable on top and below text
You do not have the required permissions to view the files attached to this post.
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Re: Form lable on top and below text
Hi,
I created a function custFieldLabelsOnTop() to position a label on top of a field.
Usage:
Example 1: Place the labels of all fields above the input fields:
Example 2: Place the labels of all fields above the input fields, but exclude some
Example 3: Place the labels of some fields above the input fields
I created a function custFieldLabelsOnTop() to position a label on top of a field.
Usage:
Example 1: Place the labels of all fields above the input fields:
Code: Select all
if (nuFormType() == 'edit') {
var f = nuSubformObject("").fields; // include all fields on your form
custFieldLabelsOnTop(f, []);
}
Code: Select all
if (nuFormType() == 'edit') {
var f = nuSubformObject("").fields; // include all fields of your form
var e = ["customer_firstname", "customer_lastname"]; // but exclude these fields
custFieldLabelsOnTop(f, e);
}
Code: Select all
if (nuFormType() == 'edit') {
var f = ["customer_firstname", "customer_lastname"]; // include just these two fields
custFieldLabelsOnTop(f, []);
}
Code: Select all
function custFieldLabelsOnTop(f, e) {
for (var i = 0; i < f.length; i++) {
if (jQuery.inArray(f[i], e) == -1) {
var t = $('#' + f[i]).cssNumber("top");
var l = $('#' + f[i]).cssNumber("left");
$('#' + 'label_' + f[i]).css({
'top': t - 18,
'left': l - 15
})
}
}
}
jQuery.fn.cssNumber = function(prop){
var v = parseInt(this.css(prop),10);
return isNaN(v) ? 0 : v;
};
-
- Posts: 41
- Joined: Thu Jan 25, 2018 3:51 pm
Re: Form lable on top and below text
Thank you very much tom. It is working exactly the way it shoud be. thank you very much for your support.