Page 1 of 1

FORM_REQUIRED_INPUT - Moving Asterisk

Posted: Fri Apr 30, 2021 4:06 pm
by Dnj1964
asterisk.png
Trying to move the asterisk with CSS tried many variations of code

Code: Select all

.form-control-feedback {right: 30px;!Important}
Any help greatly appreciated.

Re: FORM_REQUIRED_INPUT - Moving Asterisk

Posted: Fri Apr 30, 2021 9:06 pm
by zipurman
You could do:

Code: Select all

input + span .fa-asterisk::before {
    position: relative !important;
    right: -20px;
}
select + span .fa-asterisk::before {
    position: relative !important;
    right: -10px;
}

Re: FORM_REQUIRED_INPUT - Moving Asterisk

Posted: Thu May 06, 2021 6:06 pm
by plamastus
Where exactly do I add that code?

I added it to the gustavo.css, but made no diference.

Thanks

Re: FORM_REQUIRED_INPUT - Moving Asterisk

Posted: Thu May 06, 2021 6:35 pm
by zipurman
Into your user.css file. Not sure where in the stack your gustavo.css is being loaded. The style needs to be loaded after fontawesome. You could also try:

Code: Select all

input + span .fa-asterisk::before {
    position: relative !important;
    right: -20px !important;
}
select + span .fa-asterisk::before {
    position: relative !important;
    right: -10px !important;
}

Re: FORM_REQUIRED_INPUT - Moving Asterisk

Posted: Thu May 06, 2021 6:54 pm
by plamastus
Hi,

Thanks...

It does work, but it seems to me that it's on the way when attributes are long...

Thanks,

Re: FORM_REQUIRED_INPUT - Moving Asterisk

Posted: Thu May 06, 2021 7:15 pm
by zipurman
The asterisk is being placed at the end of the field using font awesome and css. It cannot detect the length of the content. You could either remove it, or you could change the logic for it to append after the field. Anything is possible ... just depends on what is needed.

Re: FORM_REQUIRED_INPUT - Moving Asterisk

Posted: Fri May 07, 2021 4:48 pm
by heatherbell
plamastus wrote: Thu May 06, 2021 6:54 pm it seems to me that it's on the way when attributes are long...
Yes, if 'Add Helper Text' and 'Enforce Selection' are set to 'True' in module, I don't think the asterisk is helpful to anyone so in that case we remove it.
E.g in cm_pi_options_attributes.php, change line 31 to

Code: Select all

$fr_input    = '';

Re: FORM_REQUIRED_INPUT - Moving Asterisk

Posted: Fri May 07, 2021 6:02 pm
by zipurman
Or you could add the following css to your user.css

Code: Select all

input + span .fa-asterisk::before {
    content: '' !important;
}
select + span .fa-asterisk::before {
    content: '' !important;
}