Assistance needed- Return home & pull username
Posted: Fri Jul 06, 2018 5:10 pm
So I am making steady progress getting my projects working as I need on Nubuilder Forte, and with the help of the search function on the forum I am getting a lot right with my lack of JavaScript knowledge.
I just have two problems:
1. I have added the following code to automatically populate the username field on my form, and it is working 100%.
The problem is, if I go and edit that item with another user, it changes the username again to current user, I need to be able to keep the original user as the one that submitted the 1st entry. I'm guessing I need some sort of if statement, but I am clueless as to what it needs to be.
2. When the user saved the data for the 1st time, I would like them to return to the main page and not remain on the data they just submitted, I found the nuGetBreadcrumb(0) option, but it doesn't work correctly( more like I'm using it incorrectly probably).
Again, thanks in advanced.
P.S. As soon as the project goes into production, I will be making a donation to the project, as it has put me in a excellent position to help my clients with their specific requirements.
I just have two problems:
1. I have added the following code to automatically populate the username field on my form, and it is working 100%.
Code: Select all
function getUserName(){
var u = nuUserName();
if ( u == null) {
u= "globeadmin";
}
return u;
}
$('#MYFIELDNAME').val(getUserName()).change();;
2. When the user saved the data for the 1st time, I would like them to return to the main page and not remain on the data they just submitted, I found the nuGetBreadcrumb(0) option, but it doesn't work correctly( more like I'm using it incorrectly probably).
Again, thanks in advanced.
P.S. As soon as the project goes into production, I will be making a donation to the project, as it has put me in a excellent position to help my clients with their specific requirements.