<script type="text/javascript"> var checked = -1; var confirmed = true; function confirmOption() { form = document.form1; if ( checked != -1 ) { confirmed = confirm( "Changing your selection will delete any previously entered data for another selection. Are you sure you want to select another option?" ); } if ( confirmed ) { for ( i = 0; i <= form.kind_program.length; i++ ) { if ( form.kind_program[i].checked == true ) { kindProgramInputs(); checked = i; } } } else { form.kind_program[checked].checked = true; confirmed = false; } } function kindProgramInputs() { alert("Funca"); }</script>