pieform: "for" attribute of lable does not handle the form id

Bug #771154 reported by laurentopprecht1
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Richard Mansfield

Bug Description

Create a pieform with a specific name
add a text box with a lable
the text box id is formname_textboxname
the label "for" attribute is textboxname instead of formname_textboxname

Tags: bite-sized
Revision history for this message
laurentopprecht1 (laurent-opprecht) wrote :

Mahara version 1.3.3 (2010083110)

Changed in mahara:
status: New → Incomplete
status: Incomplete → Triaged
importance: Undecided → Low
milestone: none → 1.4.0
tags: added: bite-sized
Revision history for this message
Richard Mansfield (richard-mansfield) wrote :

Hi Laurent,

Could you give an example of a label that has the incorrect id in the for attribute? I can't seem to reproduce this.

Changed in mahara:
assignee: nobody → Richard Mansfield (richard-mansfield)
status: Triaged → Incomplete
Revision history for this message
laurentopprecht1 (laurent-opprecht) wrote : Re: [Bug 771154] Re: pieform: "for" attribute of lable does not handle the form id

Here is my code. I use it for a module I am working on.

         $result = array(
             'name' => 'av'.$id,
             'renderer' => 'oneline',
             'successcallback' => 'archiveview_submit',
             'elements' => array(
                 'viewid' => array('type' => 'hidden', 'value' => $id),
                 'note' => array(
                     'type' => 'text',
                     'title' => get_string('note', 'artefact.version'),
                     //'rules' => array( 'required' => true ),
                 ),
                 'submit' => array(
                     'type' => 'submit',
                     'class' => 'quiet',
                     'name' => 'archive_submit',
                     'value' => get_string('Archive', 'artefact.version'),
                     //'confirm' => get_string('confirmdelete',
'artefact.version'),
                 ),
             ),
         );

         $result = pieform($result);

Output

    <form class="pieform"name="av196"method="post"action=""id="av196">
    <div><span id="av196_note_container"class="text"><label *for**="note"*>Note</label><input type="text"class="text"*id=**"av196_note"* name="note"tabindex="1"value="">

Le 27.04.2011 02:59, Richard Mansfield a écrit :
> Hi Laurent,
>
> Could you give an example of a label that has the incorrect id in the
> for attribute? I can't seem to reproduce this.
>

Revision history for this message
Richard Mansfield (richard-mansfield) wrote :

Laurent,

I've reproduced this now, it happens for forms with 'renderer' => 'oneline'.

Changed in mahara:
status: Incomplete → In Progress
Changed in mahara:
status: In Progress → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.