Hi,
I am learning javascript and need help putting together a script that will do the following:
I have three text fields where users enter data. I would like to take that data and provide a summary in a 4th text field. If a text field is null it should be skipped.
textfield1
textfield2
textfield3
Summary of data entered above should be displayed in textfield4.
text1
text2
text3
Your help would be much appreciated.
Thanks!
varns
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
On the calculate event of the textfield4 put the following (or something like it):
var str1 = "";
var str2 = "";
var str3 = "";
var str4 = "";
if (TextField1.rawValue != null)
{
str1 = TextField1.rawValue + "\u000a";
}
if (TextField2.rawValue != null)
{
str2 = TextField2.rawValue + "\u000a";
}
if (TextField3.rawValue != null)
{
str3 = TextField3.rawValue;
}
str4 = str1 + str2 + str3;
if (str4 > "")
{
this.rawValue = str4;
}
else
{
this.rawValue = "";
}
You may need to tweak it for your exact needs--good luck!
Stephen
Views
Replies
Total Likes
Hi,
On the calculate event of the textfield4 put the following (or something like it):
var str1 = "";
var str2 = "";
var str3 = "";
var str4 = "";
if (TextField1.rawValue != null)
{
str1 = TextField1.rawValue + "\u000a";
}
if (TextField2.rawValue != null)
{
str2 = TextField2.rawValue + "\u000a";
}
if (TextField3.rawValue != null)
{
str3 = TextField3.rawValue;
}
str4 = str1 + str2 + str3;
if (str4 > "")
{
this.rawValue = str4;
}
else
{
this.rawValue = "";
}
You may need to tweak it for your exact needs--good luck!
Stephen
Views
Replies
Total Likes
Stephen,
Thanks! That works great. I'm able to tweak it to suit my needs. I appreciate the help.
varns
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies