I am trying to get the first name of an employee out of an Full Employee Name text field on my form (called EmpName) but I keep getting nothing. I put the javascript code in the EmpName change event as follows:
Form0930.Page1.EmpName::change - (JavaScript, client)
var nameArray = this.rawValue.split(" ");
Page3.Congratulations.rawValue = "Congratulations " + nameArray[0] + "!";
I would put in test data in the Full Name field but only 'Congratulations ! ' displays in my text box.
Thanks,
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Your java script code seems correct. Write this code on the Exit event of 'Form0930.Page1.EmpName'.
Thanks
Views
Replies
Total Likes
Hi,
there are several ways to get the first name.
You can for example use a regular expression to find the first word in a string.
The just needs one line of code.
Put this script into the chage event of your field.
Hope this helps.
Views
Replies
Total Likes
Hi,
Your java script code seems correct. Write this code on the Exit event of 'Form0930.Page1.EmpName'.
Thanks
Views
Replies
Total Likes
That worked! Thank you so much! I thought I was losing my mind when my code didn't work.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies