Heyas Susan, thanks for the suggestions. However, I’m a newbie and my attempts at making custom scripts were not successful. :’(
Please help.
This is what I tried first, using the OnBeforeWebSaveUser function.
The webloginPE profile call:
[!NameCombine!]
[!WebLoginPE? &OnBeforeWebSaveUser=’NameCombine’ &type=`profile` &profileTpl=`Profile` &customFields=`firstname,lastname,address1,address2` !]
and the snippet:
<?php
if( !function_exists(’OnBeforeWebSaveUser’) ){
function OnBeforeWebSaveUser(&$fields){
$fullname = $modx->db->escape($modx->stripTags($_POST[’firstname’].’ ’.$_POST[’lastname’]));
}
}
?>
This did not work
Next I tried the javascript thingy, here’s my call:
[!WebLoginPE? &customJs=`assets/snippets/webloginpe/js/namo.js` &type=`profile` &profileTpl=`Profile` &customFields=`firstname,lastname,address1,address2` !]
and the script:
function namo(){
var f,n,m;
n=document.getElementById("wlpeUserProfileFirstName").value;
m=document.getElementById("wlpeUserProfileLastName").value;
f=n+m;
document.getElementById("wlpeUserProfileFullName").value = f;
}
This did not work too
Where did I go wrong?
Also, can you please show how to use a plugin with the OnWebSaveUser event?
Thanks.