I have a dropdown box that has names listed last name , first name (Doe, John). What I'm wanting to do is reverse the order of the names (John Doe) in a text box. Is this a possibility to do something like this and if how is it done? Thanks in advance.
Solved! Go to Solution.
Views
Replies
Total Likes
You can use the JavaScript split method to create an array from the selected drop down value and then assign the items in the array to the respective name field.
// form1.page1.name::exit - (JavaScript, client)
if (!(this.isNull)) {
var nameStr = this.rawValue;
var nameArray = nameStr.split(",");
form1.page1.firstName.rawValue = nameArray[1];
form1.page1.lastName.rawValue = nameArray[0];
}
Steve
Views
Replies
Total Likes
You can use the JavaScript split method to create an array from the selected drop down value and then assign the items in the array to the respective name field.
// form1.page1.name::exit - (JavaScript, client)
if (!(this.isNull)) {
var nameStr = this.rawValue;
var nameArray = nameStr.split(",");
form1.page1.firstName.rawValue = nameArray[1];
form1.page1.lastName.rawValue = nameArray[0];
}
Steve
Views
Replies
Total Likes
Steve
Thanks again for your assistance, it worked great!
Views
Replies
Total Likes
Hi Steve,
I would like to do a similar thing but instead of the drop down list, it is a text box and its value populates from a web service that created in workbench. e.g. full name in the text box ppopulate: "Smith, John T" then I'd like to convert it to "John T Smith"
Can you please advise.
Thanks in advance,
Han Dao
Views
Replies
Total Likes