how to add a little note near of field firstname/surname in signup page ?

how to add a little note near of field firstname/surname in signup page ?

by REMI PICARD (substitute) -
Number of replies: 6

hi,


in the signup page, i wish to add a little note just near the field label (both first name and surname fielfds).

i don't want them to use cyrilic or asia letters, but only alphabetic latin letter.

how can i perform this layout ?

i lookat the html code into signup.php and signup_form.php but there is no way to add basic html code (like span tag).

how can i do that ?

maybe there is a little plugin to add rule to validate the field with rule ?

ps : i think about changing the translation language but i don't want to change the label field because there will be cascadade layout each time moodle will re-use "first name" or "surname" in moodle site.

thank for help.


Average of ratings: -
In reply to REMI PICARD (substitute)

Re: how to add a little note near of field firstname/surname in signup page ?

by Jon Bolton -
Picture of Testers
You can add it very easily using the “instructions” box in Manage Authentication (by far the easiest option to do and maintain) - see https://docs.moodle.org/37/en/Managing_authentication#.27Is_this_your_first_time_here.3F.27_instructions

Or you could add an ::after selector to those specific input fields (gives you more control and will be nearer the relevant fields) - see https://www.w3schools.com/cssref/sel_after.asp

Or you could edit the relevant php file (not recommended as it would be changing core code).
In reply to Jon Bolton

Re: Re: how to add a little note near of field firstname/surname in signup page ?

by REMI PICARD (substitute) -
i'd prefer the second way.

but css tag only work for class, not for ID.
the input field for first name and surname are input#id_firstname and input#id_firstname


i added in the css file :
input#id_lastname::after {
  content: " TEST NOTE TEST";
}

but there is no working effect.(i clean cach and reload the page)
In reply to REMI PICARD (substitute)

Re: Re: Re: how to add a little note near of field firstname/surname in signup page ?

by REMI PICARD (substitute) -
i tried
#id_lastname::-webkit-input-placeholder::after {
display:block;
content:"TEST NOTE TEST";
}

not working either sad
In reply to REMI PICARD (substitute)

Re: Re: Re: how to add a little note near of field firstname/surname in signup page ?

by Jon Bolton -
Picture of Testers
Can you share the URL of your signup page? Mine shows fitem_id_firstname, so if you can share the URL I can inspect the page and maybe help with the proper syntax.
In reply to Jon Bolton

Re: how to add a little note near of field firstname/surname in signup page ?

by Jon Bolton -
Picture of Testers

Sorry, after some digging and testing, it appears you can't use ::after on a text input field.

You could still put it on the label though.

This works:

#page-login-signup label[for="id_firstname"]::after { 
 content: "- please only use alphabetic Latin letters";
}

If you want it to break the additional content onto a new line, you can add a display rule:

#page-login-signup label[for="id_firstname"]::after { 
 content: "- please only use alphabetic Latin letters";
 display: inline-block;
}

And last name is:

label[for="id_lastname"]::after


If you want to make that statement at the beginning of the "More details" section, you could add the ::after to the section header:

#page-login-signup fieldset#id_supplyinfo legend.ftoggler::after {
 content: "- hello";
 display: inline-block;
}
Average of ratings: Useful (1)
In reply to Jon Bolton

Re: Re: how to add a little note near of field firstname/surname in signup page ?

by REMI PICARD (substitute) -
thank you a lot.

this solution just works fine !
[solved] !!