Force login lowercase?

15 views
Skip to first unread message

elijah....@gmail.com

unread,
Jan 14, 2022, 12:11:03 PM1/14/22
to xnat_discussion
I'm looking into the possibility of trying to force usernames to be lowercase on login/registration, and wondering how complicated that would be...

A good place to start seems like it would be using a toLowerCase() function somewhere in Login.vm and Register.vm, or something along those lines, but I am not a web developer so I'm a bit out of my depth there...

I did find a line in Login.vm:
    var _username = _form.find('[name="username"]');

Which I think I recognize as JavaScript, but the weird thing is it appears to commented out ... and I was unable to find any other line on that page that looks like it's retrieving a the username from the form...

Can anyone point me in the right direction, or give me some idea of what this would take to implement?

Thanks,
-Eli

Richard Cole

unread,
Jan 14, 2022, 5:12:44 PM1/14/22
to xnat_di...@googlegroups.com
Eli, 

I found a simple JavaScript, and inserted it into the Login.VM and seems to be working..

FYI..

<script>
function forceLower(strInput)
{
strInput.value=strInput.value.toLowerCase();
{
</script>

              <p>
                    <label for="username">User</label>          
                    <input type="text"
                           id="username"
                           name="username"
                           onkeyup="return forceLower(this);"
                           title="User"
                           class="validate onblur"
                           data-validate="not-empty"
                           data-message="Username cannot be blank.">
                </p>

--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xnat_discussion/ea58e38d-fb62-4fca-b63a-b6d79fe02b2en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages