Revision 1255:90d92ad3fc59 public
| public/javascripts/ssamr_institutions.js | ||
|---|---|---|
| 3 | 3 |
/* SSAMR specific functions */ |
| 4 | 4 |
|
| 5 | 5 |
/* institution related functions */ |
| 6 |
Event.observe(window, 'load', |
|
| 7 |
function() {
|
|
| 8 |
$('ssamr_user_details_institution_type_true').observe('click', function(e, el) {
|
|
| 9 |
$('ssamr_user_details_other_institution').disable();
|
|
| 10 |
$('ssamr_user_details_institution_id').enable();
|
|
| 6 |
$(document).ready(function(){
|
|
| 7 |
$('#ssamr_user_details_institution_type_true').click(function() {
|
|
| 8 |
$('#ssamr_user_details_other_institution').attr('disabled', 'disabled');
|
|
| 9 |
$('#ssamr_user_details_institution_id').removeAttr('disabled');
|
|
| 11 | 10 |
}); |
| 12 | 11 |
|
| 13 |
$('ssamr_user_details_institution_type_false').observe('click', function(e, el) {
|
|
| 14 |
$('ssamr_user_details_other_institution').enable();
|
|
| 15 |
$('ssamr_user_details_institution_id').disable();
|
|
| 12 |
$('#ssamr_user_details_institution_type_false').click(function() {
|
|
| 13 |
$('#ssamr_user_details_other_institution').removeAttr('disabled');
|
|
| 14 |
$('#ssamr_user_details_institution_id').attr('disabled', 'disabled');
|
|
| 16 | 15 |
}); |
| 17 |
|
|
| 18 |
if($('ssamr_user_details_institution_type_true').checked)
|
|
| 19 |
$('ssamr_user_details_other_institution').disable();
|
|
| 16 |
|
|
| 17 |
if($('#ssamr_user_details_institution_type_true').checked)
|
|
| 18 |
$('#ssamr_user_details_other_institution').attr('disabled', 'disabled');
|
|
| 20 | 19 |
else if($('ssamr_user_details_institution_type_false').checked)
|
| 21 |
$('ssamr_user_details_institution_id').disable();
|
|
| 20 |
$('#ssamr_user_details_institution_id').attr('disabled', 'disabled');
|
|
| 22 | 21 |
else {
|
| 23 |
$('ssamr_user_details_other_institution').disable();
|
|
| 24 |
$('ssamr_user_details_institution_id').enable();
|
|
| 25 |
$('ssamr_user_details_institution_type_true').checked = true;
|
|
| 26 |
$('ssamr_user_details_institution_type_false').checked = false;
|
|
| 22 |
$('#ssamr_user_details_other_institution').attr('disabled', 'disabled');
|
|
| 23 |
$('#ssamr_user_details_institution_id').removeAttr('disabled');
|
|
| 24 |
$('#ssamr_user_details_institution_type_true').checked = true;
|
|
| 25 |
$('#ssamr_user_details_institution_type_false').checked = false;
|
|
| 27 | 26 |
} |
| 28 | 27 |
} |
| 29 | 28 |
); |
Also available in: Unified diff