2.9 Add tag to signup form field (Username) using renderer

2.9 Add tag to signup form field (Username) using renderer

by Eugene Lim -
Number of replies: 0

Hi all,

I have a problem where mobile phones automatically capitalize usernames in the signup forms, causing signups to fail because usernames must be lowercase only. While I made a backend plugin that automatically downcases usernames on signup (https://github.com/spaceraccoon/moodle-auth_lowerusername), I would like a cleaner solution on the front end.

I want to add an 

autocapitalize="none" tag to my username form field. In short, I want to turn

<input maxlength="100" size="12" name="username" type="text" id="id_username">

to

<input maxlength="100" size="12" autocapitalize="none" name="username" type="text" id="id_username">

Of course, this has turned out to be pretty complicated. I modified the instructions at https://moodle.org/mod/forum/discuss.php?d=244343 to use a renderer override for the signup block (instead of login block) but it didn't work. I'm using the Clean theme version 2015051100 on Moodle 2.9, but ideally this solution should be general enough. 


The question being, how do I modify my theme (particularly the renderer) to add the autocapitalize tag to the login form field?



Average of ratings: -