avoiding repetitive code
avoiding repetitive code
hey guys,
i have following code, that i am sure can be done in 1 single function, which will ease extending it in future.
- $('#import_active').click(function() {
$('#error_notice').hide('slow');
$('#upload_storno').hide();
$('#upload_new').hide();
$('#upload_active').show('slow');
return false;
});
$('#import_storno').click(function() {
$('#error_notice').hide('slow');
$('#upload_active').hide();
$('#upload_new').hide();
$('#upload_storno').show('slow');
return false;
});
$('#import_new').click(function() {
$('#error_notice').hide('slow');
$('#upload_active').hide();
$('#upload_storno').hide();
$('#upload_new').show('slow');
return false;
});
basically when a link is clicked, i wante the upload form to apear....and any other upload forms to disapear.
how can i put those 3 functions in 1?