view public/javascripts/ssamr_institutions.js @ 1458:b1f4c9a2af24 bug_794

Makes the default radio button checked by default -- this should fix bug #794.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Mon, 11 Nov 2013 18:25:22 +0000
parents 90d92ad3fc59
children
line wrap: on
line source


/* SSAMR specific functions */

/* institution related functions */
$(document).ready(function(){
	$('#ssamr_user_details_institution_type_true').click(function() {
        $('#ssamr_user_details_other_institution').attr('disabled', 'disabled');
        $('#ssamr_user_details_institution_id').removeAttr('disabled');
	});

	$('#ssamr_user_details_institution_type_false').click(function() {
        $('#ssamr_user_details_other_institution').removeAttr('disabled');
        $('#ssamr_user_details_institution_id').attr('disabled', 'disabled');
	});

    if($('#ssamr_user_details_institution_type_true').checked)
        $('#ssamr_user_details_other_institution').attr('disabled', 'disabled');
    else if($('ssamr_user_details_institution_type_false').checked)
        $('#ssamr_user_details_institution_id').attr('disabled', 'disabled');
	else {
		$('#ssamr_user_details_other_institution').attr('disabled', 'disabled');
        $('#ssamr_user_details_institution_id').removeAttr('disabled');
        $('#ssamr_user_details_institution_type_true').checked = true;
        $('#ssamr_user_details_institution_type_false').checked = false;
	}
}
);