Sounds like homework! Or do you think that this forum is a free coding service?
Show us your effort and then I am sure that someone will correct/improve it for you. If the user may select more than one extra then you need to use checkboxes, not radios.
This will give you a start:-
Code:
<form name= "myform">
<input type = "radio" name = "rad1" value = "20Package1">Package 1
<input type = "radio" name = "rad1" value = "50Package2">Package 2
<input type = "radio" name = "rad1" value = "75Package3">Package 3
<br><br>
<input type = "button" value = "Which Package Selected?" onclick = "chkrads()">
</form>
<script type = "text/javascript">
function chkrads() {
var chosen = "None";
var len = document.myform.rad1.length;
for (i = 0; i <len; i++) {
if (document.myform.rad1[i].checked) {
chosen = document.myform.rad1[i].value;
}
}
if (chosen == "None") {
alert("No Package Chosen");
}
else {
var price = parseInt(chosen);
var pl = price.toString().length;
chosen = chosen.substring(pl);
alert("You selected " + chosen + " costing £" + price);
}
}
</script>
BTW, the time to say "thanks" is afterwards, not beforehand which gives the - doubtless unintended - impression that you take other people's voluntary unpaid assistance and expertise for granted. Or as British politician Neil Kinnock put it, "Don't belch before you have had the meal." Prefer to use "please" beforehand and if you find a response helpful then you can use the "Thank User For This Post" button.
The ball is unpredicatble, but not all the time. - Football Commentator, Radio 5 Live