Is it possible to pass the selected radio button value to textbox in one page using modal ? im trying to make an attendance form for library, that the students will click the select purpose button and modal will appear they will choose either assignment or reading , after they select and click the confirm button the selected radio button will appear in the textbox. hope you can help me with this one. advance thanks.
heres my sample code:
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
</head>
<body>
<form class="inputForm" >
<div class="inputbox">
<input type="text" required/>
<label>Purpose</label>
</div>
<input type="submit" value="Select Purpose" class="button1" data-toggle="modal" data-target="#exampleModal">
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Purpose:</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="custom-control custom-radio">
<input type="radio" id="customRadio1" name="customRadio" class="custom-control-input">
<label class="custom-control-label" for="customRadio1">Assignment</label>
</div>
<div class="custom-control custom-radio">
<input type="radio" id="customRadio2" name="customRadio" class="custom-control-input">
<label class="custom-control-label" for="customRadio2">Reading</label>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary">Confirm</button>
</div>
</div>
</div>
</div>
</form>
</body>
</html>