In Jquery, it's more along the lines of this. I guessed at the ID or the radio button set, won't work, just an example of how to format it. but it's closer to what you want. So it binds the change event to the DOM, and fires the function, passing the event to it. Radio buttons are checkboxs, they act the same, and have the same events, so think of them as checkboxes. If you have a group of them, say 2, then you have to get the selected index of the 2 radio buttons, which is an array of values, from the DOM. That's what the [0] is for. I was about to leave tor the night and sleep, but wanted to help a little more if possible. I can tell your not that familiar with Jquery. If you have an update panel on the page, this won't work after using the update panel once, because the DOM unloaded.
<script language="JavaScript" type="text/javascript">
$(document).ready( function() {
$('\[id\*="radbutSelector"\]').change( function(event) {
confirmDelete(event);
});
});
function confirmDelete(event) {
var newradio= $("input\[name='pick\_up\_point'\]:checked")\[0\];
if (newradio===currentradio)
return;
if (confirm('Address details will be cleared. Continue?')) {
clearInputFields();
currentradio= newradio;
} else {
currentradio.checked= true;
}
}
</script>