• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Accessibility on Form Builder
PostPosted: Tue Nov 07, 2006 12:00 pm 
Offline
Forum Members
Forum Members

Joined: Wed Jun 22, 2005 8:02 am
Posts: 30
I am trying to make a form template in form builder that actually makes an accessible form. This is where static text added is a fieldset wrapping the containing items, the form itself is a definition list (something I think is appropriate as the labels are in a sense definitions of the  fields they label) and it incorporates multiple radio group etc.

If someone could aide me in the smarty part of it, I would be greatly appreciative, or even some of the accessibility stuff.

I have tried the following:

{$hidden}

{if $total_pages gt 1}
{$title_page_x_of_y}
{/if}

{foreach from=$fields item=entry}
  {if $entry->display == 1}
    {strip}
{if $entry->type == '-Static Text'}
{$entry->name}
{else}

{if $entry->required == 1 || $entry->css_class != ''} class="
{if $entry->required == 1}
required
{/if}
{if $entry->required == 1 && $entry->css_class != ''} {/if}
{if $entry->css_class != ''}
{$entry->css_class}
{/if}
"
{/if}
{if $entry->hide_name == 0}

{if $entry->required_symbol != ''}
{$entry->required_symbol}
{/if}
{/if}

{if $entry->multiple_parts == 1}

{foreach from=$entry->input item=part}
{$part->name}

{$part->input}

{/foreach}

{else}
{$entry->input}

{/if}
{if $entry->valid == 0} <--- {/if}

{/if}
    {/strip}
  {/if}
{/foreach}

{$prev}{$submit}



Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Accessibility on Form Builder
PostPosted: Tue Nov 07, 2006 5:05 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 7997
Location: Fernie British Columbia, Canada
Cuhl and I found a solution  this in the IRC channel, here's the resulting template.

Note, there's also a one line fix in FormBuilder/classes/Form.class.php to get the template working properly
check out the svn repository for the formbuilder module and you'll see it.

Code:
{$hidden}
<div{if $css_class != ''} class="{$css_class}"{/if}>
{assign var=open value=0}
{if $total_pages gt 1}<div class="status">{$title_page_x_of_y}</div>{/if}
{foreach from=$fields item=entry}
     {if $entry->display == 1}
          {strip}
         {if $entry->type == '-Static Text'}
                        {if $open == 1 }</fieldset>{assign var=open value=0}{/if}
         <fieldset>{assign var=open value=1}
                        <legend>{$entry->name}</legend>{$entry->input}
         {else}
            {if $entry->required == 1 || $entry->css_class != ''} class="
               {if $entry->required == 1}
                  required
               {/if}
               {if $entry->required == 1 && $entry->css_class != ''} {/if}
               {if $entry->css_class != ''}
                  {$entry->css_class}
               {/if}
               "
            {/if}
            {if $entry->hide_name == 0}
               <label for="{$entry->input_id}">{$entry->name}</label>
               {if $entry->required_symbol != ''}
                  {$entry->required_symbol}
               {/if}
            {/if}
            {if $entry->multiple_parts == 1}
            <dl>
               {foreach from=$entry->input item=part}
                  <dt>{$part->name}</dt>
                  <dd>{$part->input}</dd>
               {/foreach}
            </dl>
            {else}
            {$entry->input}
            {/if}
            {if $entry->valid == 0} <--- {/if}
         {/if}
          {/strip}
     {/if}
{/foreach}
{if $open == 1}</fieldset>{assign var=open value=0}{/if}
<div class="submit">{$prev}{$submit}</div>
</div>

_________________
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Accessibility on Form Builder
PostPosted: Tue Nov 07, 2006 5:12 pm 
Offline
Forum Members
Forum Members

Joined: Wed Jun 22, 2005 8:02 am
Posts: 30
Got another change to the form, to incorporate the required class and star into the label. This should be accessible now:
Quote:
{$hidden}

{assign var=open value=0}
{if $total_pages gt 1}
{$title_page_x_of_y}
{/if}
{foreach from=$fields item=entry}
  {if $entry->display == 1}
    {strip}
{if $entry->type == '-Static Text'}
                        {if $open == 1 }{assign var=open value=0}{/if}
{assign var=open value=1}
                        {$entry->name}
{else}
{if $entry->hide_name == 0}
{$entry->input}
{/if}
{if $entry->multiple_parts == 1}

{foreach from=$entry->input item=part}
{$part->name}

{$part->input}

{/foreach}

{/if}
{if $entry->valid == 0} <--- {/if}
{/if}
    {/strip}
  {/if}
{/foreach}
{if $open == 1}
{assign var=open value=0}{/if}
{$prev}{$submit}




Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
A2 Hosting