modules/raptor_glue/js/formHelper.js
/**
 * Clear all the values in the section.
 */
Clear all the values in the section.
Clear all the values in the section .
function clearValuesInSection(sectionname)
{
    var id_map = getProtocolControlIDMap();
    notDefaultValuesInSection(sectionname);    
    if(sectionname === 'hydration')
    {
        var ackid = id_map[sectionname]['acknowledge']['checkbox'];
        setDefaultInRadioTypeSection(sectionname, ackid, '', '');
        setAsPickFromListByName('hydration_oral_');
        setAsPickFromListByName('hydration_iv_');
        var id_none = id_map[sectionname]['radio']['id_none'];
        activateRadioButtonById(id_none);
    } else
    if(sectionname === 'sedation')
    {
        var ackid = id_map[sectionname]['acknowledge']['checkbox'];
        setDefaultInRadioTypeSection(sectionname, ackid, '', '');
        setAsPickFromListByName('sedation_oral_');
        setAsPickFromListByName('sedation_iv_');
        var id_none = id_map[sectionname]['radio']['id_none'];
        activateRadioButtonById(id_none);
    } else
    if(sectionname === 'contrast')
    {
        var ackid = id_map[sectionname]['acknowledge']['checkbox'];
        setDefaultInCheckboxTypeSection(sectionname, ackid, '', '');
        var id_none = id_map[sectionname]['checkbox']['id_none'];
        var id_enteric = id_map[sectionname]['checkbox']['id_enteric'];
        var id_iv = id_map[sectionname]['checkbox']['id_iv'];
        clearCheckboxById(id_enteric);
        clearCheckboxById(id_iv);
        activateCheckboxById(id_none);
    } else
    if(sectionname === 'consentreq')
    {
        var id_unknown = id_map[sectionname]['checkbox']['id_unknown'];
        activateRadioButtonById(id_unknown);
        var radiobtn = document.getElementById(id_unknown);
        radiobtn.checked = false;   
    } else
    if(sectionname === 'radioisotope' || sectionname === 'contrast')
    {
        var ackid = id_map[sectionname]['acknowledge']['checkbox'];
        setDefaultInCheckboxTypeSection(sectionname, ackid, '', '');
        var id_none = id_map[sectionname]['checkbox']['id_none'];
        var id_enteric = id_map[sectionname]['checkbox']['id_enteric'];
        var id_iv = id_map[sectionname]['checkbox']['id_iv'];
        clearCheckboxById(id_enteric);
        clearCheckboxById(id_iv);
        activateCheckboxById(id_none);
    } else
    if(sectionname === 'protocolnotes')
    {
        var id_textarea = id_map[sectionname]['textarea']['id'];
        var textbox = document.getElementById(id_textarea);
        textbox.value = '';
    } else
    if(sectionname === 'examnotes')
    {
        var id_textarea = id_map[sectionname]['textarea']['id'];
        var textbox = document.getElementById(id_textarea);
        textbox.value = '';
    }
}
function clearValuesInSection ( sectionname ) { var id_map = getProtocolControlIDMap ( ) ; notDefaultValuesInSection ( sectionname ) ; if ( sectionname === 'hydration' ) { var ackid = id_map [ sectionname ] [ 'acknowledge' ] [ 'checkbox' ] ; setDefaultInRadioTypeSection ( sectionname , ackid , '' , '' ) ; setAsPickFromListByName ( 'hydration_oral_' ) ; setAsPickFromListByName ( 'hydration_iv_' ) ; var id_none = id_map [ sectionname ] [ 'radio' ] [ 'id_none' ] ; activateRadioButtonById ( id_none ) ; } else if ( sectionname === 'sedation' ) { var ackid = id_map [ sectionname ] [ 'acknowledge' ] [ 'checkbox' ] ; setDefaultInRadioTypeSection ( sectionname , ackid , '' , '' ) ; setAsPickFromListByName ( 'sedation_oral_' ) ; setAsPickFromListByName ( 'sedation_iv_' ) ; var id_none = id_map [ sectionname ] [ 'radio' ] [ 'id_none' ] ; activateRadioButtonById ( id_none ) ; } else if ( sectionname === 'contrast' ) { var ackid = id_map [ sectionname ] [ 'acknowledge' ] [ 'checkbox' ] ; setDefaultInCheckboxTypeSection ( sectionname , ackid , '' , '' ) ; var id_none = id_map [ sectionname ] [ 'checkbox' ] [ 'id_none' ] ; var id_enteric = id_map [ sectionname ] [ 'checkbox' ] [ 'id_enteric' ] ; var id_iv = id_map [ sectionname ] [ 'checkbox' ] [ 'id_iv' ] ; clearCheckboxById ( id_enteric ) ; clearCheckboxById ( id_iv ) ; activateCheckboxById ( id_none ) ; } else if ( sectionname === 'consentreq' ) { var id_unknown = id_map [ sectionname ] [ 'checkbox' ] [ 'id_unknown' ] ; activateRadioButtonById ( id_unknown ) ; var radiobtn = document . getElementById ( id_unknown ) ; radiobtn . checked = false ; } else if ( sectionname === 'radioisotope' || sectionname === 'contrast' ) { var ackid = id_map [ sectionname ] [ 'acknowledge' ] [ 'checkbox' ] ; setDefaultInCheckboxTypeSection ( sectionname , ackid , '' , '' ) ; var id_none = id_map [ sectionname ] [ 'checkbox' ] [ 'id_none' ] ; var id_enteric = id_map [ sectionname ] [ 'checkbox' ] [ 'id_enteric' ] ; var id_iv = id_map [ sectionname ] [ 'checkbox' ] [ 'id_iv' ] ; clearCheckboxById ( id_enteric ) ; clearCheckboxById ( id_iv ) ; activateCheckboxById ( id_none ) ; } else if ( sectionname === 'protocolnotes' ) { var id_textarea = id_map [ sectionname ] [ 'textarea' ] [ 'id' ] ; var textbox = document . getElementById ( id_textarea ) ; textbox . value = '' ; } else if ( sectionname === 'examnotes' ) { var id_textarea = id_map [ sectionname ] [ 'textarea' ] [ 'id' ] ; var textbox = document . getElementById ( id_textarea ) ; textbox . value = '' ; } }
Clear all the values in the section.
Clear all the values in the section .
//Start by declaring that we do not have default values selected. //Now clear all the controls in the section. //Now uncheck it too       