Hi i
have numerous text fields data binded, which i have to concatinate all of them to show on a particaular section, the thing is if the data field is null, the then it should not be shown, i mean if the data field is has nothing i get a null
my code is as follows:
this.rawValue
= xfa.resolveNode("Page7.pre_pri_sec_1").rawValue+ " " + xfa.resolveNode("Page7.pre_pri_sec_2").rawValue+" " +xfa.resolveNode("Page7.pre_pri_sec_3").rawValue+" " +xfa.resolveNode("Page7.pre_pri_sec_4").rawValue
+
" " +xfa.resolveNode("Page7.pre_pri_sec_5").rawValue+" " +xfa.resolveNode("Page7.pre_pri_sec_6").rawValue+" " +xfa.resolveNode("Page7.pre_pri_sec_7").rawValue
+
" " +xfa.resolveNode("Page7.pre_pri__sec_8").rawValue+" " +xfa.resolveNode("Page7.pre_pri_sec_9").rawValue+" " +xfa.resolveNode("Page7.pre_pri_sec_10").rawValue etc...;
so if some of the fields has no value then it is shoing as "null", how do i get rid of this null,..? and if any field has no value then there is a space left over for it.
can somebody help me on this..
Thanks in advance
Solved! Go to Solution.
Views
Replies
Total Likes
You will have to check for nulls on each field. For example, you could add the following to the calculate event of the target fiield
// form1.Page7.resultStr::calculate - (JavaScript, client)
var str = "";
if (Page7.pre_pri_sec_1.isNull) {
str = str;
}
else {
str = Page7.pre_pri_sec_1.rawValue;
}
if (Page7.pre_pri_sec_2.isNull) {
str = str + "";
}
else {
str = str + " " + Page7.pre_pri_sec_2.rawValue;
}
if (Page7.pre_pri_sec_3.isNull) {
str = str + "";
}
else {
str = str + " " + Page7.pre_pri_sec_3.rawValue;
}
.....
if (Page7.pre_pri_sec_10.isNull) {
str = str + "";
}
else {
str = str + " " + Page7.pre_pri_sec_10.rawValue;
}
this.rawValue = str;
Steve
Views
Replies
Total Likes
You will have to check for nulls on each field. For example, you could add the following to the calculate event of the target fiield
// form1.Page7.resultStr::calculate - (JavaScript, client)
var str = "";
if (Page7.pre_pri_sec_1.isNull) {
str = str;
}
else {
str = Page7.pre_pri_sec_1.rawValue;
}
if (Page7.pre_pri_sec_2.isNull) {
str = str + "";
}
else {
str = str + " " + Page7.pre_pri_sec_2.rawValue;
}
if (Page7.pre_pri_sec_3.isNull) {
str = str + "";
}
else {
str = str + " " + Page7.pre_pri_sec_3.rawValue;
}
.....
if (Page7.pre_pri_sec_10.isNull) {
str = str + "";
}
else {
str = str + " " + Page7.pre_pri_sec_10.rawValue;
}
this.rawValue = str;
Steve
Views
Replies
Total Likes
Thank you very much Steve.
Views
Replies
Total Likes