How to use String.Format to get multiple value from radio button?

For getting more than one value let us say “ID” and “Contact” from single radio button on change event you have to write code like :

<input type=”radio” class=”radio” name=”RadioButton” value=’@String.Format(“{0}|{1}”,ID,Contact />

Now for getting these value using jquery :

<script>

$(“input[name=RadioButton]:radio”).change(function () {

var arm = $(this).val();

var arr = arm.split(‘|’);

var ID = arr[0];

var Contact = arr[1];

})

</script>

Happy Coding!!.