XMLWordPrintable

Details

    • MOODLE_21_STABLE
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • MDL-30815-master
    • Easy
    • Hide
      1. Login as Admin, goto a course and add a choice activity
      2. view the activity and check the html source of the page.
      3. Make sure you see the id as an attribute to the input field.
      4. Make sure the for attribute of the label filed is same as the id attribute of input field
      5. Example:-

        <input id="choice_1" type="radio" name="answer" value="red" />
        <label for="choice_1">Red</label>

      Show
      Login as Admin, goto a course and add a choice activity view the activity and check the html source of the page. Make sure you see the id as an attribute to the input field. Make sure the for attribute of the label filed is same as the id attribute of input field Example:- <input id="choice_1" type="radio" name="answer" value="red" /> <label for="choice_1">Red</label>

    Description

      Each input element needs to be explicitly tied to a form label. The correct code looks like the following.

      <input id="choice_1" type="radio" name="answer" value="red" />
      <label for="choice_1">Red</label>
       
      <input id="choice_2" type="radio" name="answer" value="blue" />
      <label for="choice_2">Blue</label>
       
      <input id="choice_3" type="radio" name="answer" value="green" />
      <label for="choice_3">Green</label>

      The key is to have each input element directly attached to a label through a common "id" and "for" attribute.

      Attachments

        Activity

          People

            ankit_frenz Ankit Agarwal
            gdkraus Greg Kraus
            Andrew Davis Andrew Davis
            Sam Hemelryk Sam Hemelryk
            Jason Fowler Jason Fowler
            Dan Marsden, Amaia Anabitarte, Carlos Escobedo, Laurent David, Mikel Martín Corrales, Sabina Abellan, Sara Arjona (@sarjona)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              12/Mar/12