Changeset 1369


Ignore:
Timestamp:
May 23, 2011, 2:45:37 PM (11 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #322: Select multiple "not asked" sub-options

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/consentform.jsp

    r1368 r1369  
    185185  if (caseInfo.consent == 'Not asked')
    186186  {
    187     var selectedReasonIfNotAsked = Forms.getCheckedRadio(frm.reasonIfNotAsked);
    188     if (selectedReasonIfNotAsked)
     187    var reasonIfNotAsked = '';
     188    for (var i = 0; i < frm.reasonIfNotAsked.length; i++)
    189189    {
    190       if (selectedReasonIfNotAsked.id == 'notAsked.other')
     190      var option = frm.reasonIfNotAsked[i];
     191      if (option.checked)
    191192      {
    192         caseInfo.reasonIfNotAsked = frm.otherReasonIfNotAsked.value;
    193       }
    194       else
    195       {
    196         var label = document.getElementById(selectedReasonIfNotAsked.id + '.label');
    197         caseInfo.reasonIfNotAsked = label.innerHTML;
     193        if (option.id == 'notAsked.other')
     194        {
     195          reasonIfNotAsked += frm.otherReasonIfNotAsked.value;
     196        }
     197        else
     198        {
     199          var label = document.getElementById(option.id + '.label');
     200          reasonIfNotAsked += label.innerHTML + '\n';
     201        }
    198202      }
    199203    }
     204    caseInfo.reasonIfNotAsked = reasonIfNotAsked;
    200205  }
    201206 
     
    393398          <tr valign="baseline">
    394399            <td><img src="../../images/joust/joinbottom.gif"></td>
    395             <td><input id="notAsked.forgot" type="radio" name="reasonIfNotAsked" disabled></td>
     400            <td><input id="notAsked.forgot" type="checkbox" name="reasonIfNotAsked" disabled></td>
    396401            <td><label id="notAsked.forgot.label" for="notAsked.forgot" class="disabled">Forgot to ask the patient</label></td>
    397402          </tr>
     
    399404          <tr valign="baseline">
    400405            <td></td>
    401             <td><input id="notAsked.language" type="radio" name="reasonIfNotAsked" disabled></td>
     406            <td><input id="notAsked.language" type="checkbox" name="reasonIfNotAsked" disabled></td>
    402407            <td><label id="notAsked.language.label" for="notAsked.language" class="disabled">Language problems</label></td>
    403408          </tr>
     
    405410          <tr valign="baseline">
    406411            <td></td>
    407             <td><input id="notAsked.condition" type="radio" name="reasonIfNotAsked" disabled></td>
     412            <td><input id="notAsked.condition" type="checkbox" name="reasonIfNotAsked" disabled></td>
    408413            <td><label id="notAsked.condition.label" for="notAsked.condition" class="disabled">Patient can't decide due to physical and/or mental condition</label></td>
    409414          </tr>
     
    411416          <tr valign="baseline">
    412417            <td></td>
    413             <td><input id="notAsked.other" type="radio" name="reasonIfNotAsked" disabled></td>
     418            <td><input id="notAsked.other" type="checkbox" name="reasonIfNotAsked" disabled></td>
    414419            <td><label id="notAsked.other.label" for="notAsked.other" class="disabled">Other:</label></td>
    415420          </tr>
     
    419424            <td colspan="2">
    420425            <textarea name="otherReasonIfNotAsked" rows="3" cols="30" disabled
    421               onfocus="document.forms['reggie'].reasonIfNotAsked[3].click()"></textarea>
     426              onfocus="document.forms['reggie'].reasonIfNotAsked[3].checked = true"></textarea>
    422427            </td>
    423428          </tr>
Note: See TracChangeset for help on using the changeset viewer.