Welcome, Guest

move required field asterisk and validation errors
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: move required field asterisk and validation errors

move required field asterisk and validation errors 2 years, 8 months ago #8522

I am working on an accessible website and want to make sure that my forms are accessible as well. For that reason, I would like to move the asterisk that indicates a required field inside the field label rather than having it displayed after the field itself.

I also would like to repeat the validation errors that are displayed above the form below the submit button. The cursor doesn't move up to the validation messages. So having the errors repeat below the submit should help out screen reader users, I would think.

How can I accomplish the two changes?

Some more details:

What I need to do is to update the BFQuickMode.php in the administrator folder. I am trying to move the asterisk inside the label tag. I successfully moved the associated code BEFORE the label, but that creates extra space which makes the input fields that aren't required line up incorrectly compared to required fields (because now I have asterisk width plus label width in some cases and label width only in other cases.

What I am trying to do in essence, is to put:
if($mdata['required']){
echo '<span class="bfRequired">*</span>'."\n";
}
inside the label tag on line 385:
echo '<label for="ff_elem'.$mdata['dbId'].'">'.$labelText."</label>\n";

I don't understand javascript enough to make this happen, so I am really stuck. I already updated .bfRequired in the css to float left, but so far I only got the span with the asterisk to move before the label rather than inside, which causes said alignment issues.
  • melissapbr
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 2
Last Edit: 2 years, 8 months ago by melissapbr.

Re:move required field asterisk and validation errors 1 year, 12 months ago #13708

Did you ever accomplish this?

Thx ~ debi

Re:move required field asterisk and validation errors 1 year, 11 months ago #13951

I would like to move them as well. They don't line up very well on the right side.
  • DaveOzric
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
  • Karma: 0

Re:move required field asterisk and validation errors 1 year, 8 months ago #16961

I still would like to change the position of these to run along the left side. I have some sticking out in the middle of the page. Why?
  • DaveOzric
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
  • Karma: 0

Re: move required field asterisk and validation errors 1 year, 8 months ago #17071

Yes, I actually did.
Here's what I did (I think - it's been a while).

On page BFQuickMode.php (in administrator/components/com_facileforms/libraries/crosstec/classes) I changed the following:

Remove the following code from line 693-695:
if($mdata['required']){
	echo '<span class="bfRequired">*</span>'."\n";
    }


Insert right before the following (line 393):

echo '<label for="ff_elem'.$mdata['dbId'].'">'.$labelText."</label>\n";


the replacement code:
if($mdata['required']){
    echo '<span class="bfRequired">*</span>'."\n";
	}
				
	else{
		echo '<span class="bfNotRequired">&nbsp;</span>'."\n";
		}


I added the if-else statement to line up the labels that don't have an asterisk with the ones that do.


My style for the asterisk is (in components/com_facileforms/themes/quickmode/qmtheme/theme.css):
.bfQuickMode .bfRequired {
color:#FF0000;
float:left;
font-weight:bold;
margin:0;
padding:0 2px 0 0;
}


I don't remember if I had to make any other style changes. Let me know if this doesn't align correctly, and I look more into it.
  • melissapbr
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 2
  • Page:
  • 1
Moderators: TheMuffinMan, ForumSupport
Time to create page: 1.29 seconds

Facebook Discount - 40% Off!

Fans of our Facebook page here are entitled to get a 1-year-subscription for the price of a 6-months!

Steps to take:

  • Become a fan on Facebook (Like) here
  • Purchase a 6-months-subscription from here
  • Write a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your username and prove of your like and we'll upgrade to the 1-year-subscription

Joomla!® Forms Discount - 40% Off!

Already purchased a forms extension from a different vendor but your requirements changed and now you need a forms extension that is capable of more than just the standards? We help you to keep the costs for a change under control: Get a 40% discount on our professional membership plan! -- meaning timely unlimited access to all current and future commercial extensions, breezingforms themes & apps and Joomla!® templates at crosstec.de, including 1 year of support -- without any website limitations -- Just prove that you previously purchased another forms extension for Joomla!® from a different vendor and you are qualified.

Steps to take:

  • Purchase a 1-year-subscription from here
  • Write a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your username and prove of the purchase for the other form vendor and we'll upgrade to the professional-subscription

About

Crosstec GmbH & Co. KG

Bergisch-Gladbacher-Str. 829

51069 Cologne, Germany

Imprint