Quote from: BobRay at May 27, 2016, 01:09 PMIf you're adding the prefix with a snippet, either don't update the input field from the $_POST on submission, or check for an existing u before adding the prefix.
Feel free to post the existing code.
Thanks for this.
This snippet to prepend the 'u' for registration is this:
<?php
if (isset($_POST['registerbtn'])) {
$_POST['username:required'] = "u".$_POST['username:required'];
}
The snippet to prepend the 'u' for login is this:
<?php
if (isset($_POST['Login'])) {
$_POST['username'] = "u".$_POST['username'];
}
The tpl that formats the email with their login details is this:
username: <strong>[[+username:stripString=`u`]]</strong>
So that it removes the leading 'u' to avoid confusion.
The above all works - until someone submits a form without filling out all the fields, and gets an error.
But I'm not sure how to not update the input field from the $_POST on submission? Or as you suggested, to check for an existing u before adding the prefix?
I have no idea how to do this?
Thanks
Andy