Name and value in form submit in EJ2 JavaScript Radio button control

10 May 20234 minutes to read

The name attribute of the RadioButton is used to group RadioButton. When the RadioButton are grouped in form, the checked items value attribute will be post to server on form submit that can be retrieved through the name. The disabled RadioButton value will not be sent to the server on form submit.

In the following code snippet, Credit and Debit card is in checked state.
Now, the value that is in checked state will be sent on form submit.


//Name and Value attribute in form submit.
var radiobutton = new ej.buttons.RadioButton({label: 'Credit/Debit Card', name: 'payment', value: 'credit/debit', checked: true});

radiobutton = new ej.buttons.RadioButton({label: 'Net Banking', name: 'payment', value: 'netbanking'});

radiobutton = new ej.buttons.RadioButton({label: 'Cash on Delivery', name: 'payment', value: 'cashondelivery'});

radiobutton = new ej.buttons.RadioButton({label: 'Others', name: 'payment', value: 'others'});

var button = new ej.buttons.Button({ isPrimary: true });
<!DOCTYPE html><html lang="en"><head>
    <title>EJ2 RadioButton</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Typescript UI Controls">
    <meta name="author" content="Syncfusion">
    <link href="" rel="stylesheet">
    <link href="" rel="stylesheet">
    <link href="styles.css" rel="stylesheet">
<script src="" type="text/javascript"></script>
<script src="" type ="text/javascript"></script>

    <div id="container">
                <li><input type="radio" id="radiobutton1"></li>
                <li><input type="radio" id="radiobutton2"></li>
                <li><input type="radio" id="radiobutton3"></li>
                <li><input type="radio" id="radiobutton4"></li>
                <li><button id="btnElement">Submit</button></li>

var ele = document.getElementById('container');
if(ele) { = "visible";
<script src="index.js" type="text/javascript"></script>
#container {
    visibility: hidden;

#loader {
  color: #008cff;
  height: 40px;
  width: 30%;
  position: absolute;
  top: 45%;
  left: 45%;

.e-radio-wrapper {
  margin-top: 18px;

button {
  margin: 20px 0 0 5px;

li {
  list-style: none;