[[!ExtUserUpdateProfile]] [[!UpdateProfile? &preHooks=`FullName` &excludeExtended=`email:required:email,login-updprof-btn,mediaFolder` &validate=`nospam:blank, username:required, firstName:required, lastName:required, screenName:required:minLength=^3^, email:required:email` &useExtended=`0` ]] [[!SetUserPlaceholders]]
<label for="screenName">Screen Name [[!+error.screenName]]</label> <input type="text" name="screenName" id="screenName" value="[[+screenName]]">
This question has been answered by BobRay. See the first response.
if ($submission) { if (strlen($_POST['screenName']) < 3) { return ""; } ... }
if ($submission) { if (strlen($_POST['firstName']) < 1) { return ""; } if (strlen($_POST['lastName']) < 1) { return ""; } if (strlen($_POST['businessAddressCounty']) < 1) { return ""; } if (strlen($_POST['businessAddressPostcode']) < 1) { return ""; } $modx->request->sanitizeRequest(); $dirty = false; foreach ($fields as $key => $value) { if (isset($_POST[$key])) { if ($value !== $_POST[$key]) { $data->set($key, $_POST[$key]); $dirty = true; } } } if ($dirty) { $data->save(); } } return '';
if (empty($_POST['firstName'])) { return ""; }
if ( (! isset($_POST['firstName'])) || empty($_POST['firstName'])) { return ""; }
echo "POST: " . print_r($_POST, true);