JSFiddle - React, Tailwind, and code Playground

HTML

<select class="form-control" name='grupo' id='grupo' onChange="modifica(event)">
   <option value='0'>Seleccione Planilla...</option>
     <option value='1'>Primera</option>
     <option value='2'>Segunda</option>
</select>

<form name="imprimir" action="" method="POST">
	<input type="text" id="id_grupo" name="id_grupo" value="">
	<input type="text" id="name_grupo" name="name_grupo" >
	<input type="submit" class="btn btn-danger" value="IMPRIMIR">
</form>

JavaScript

function modifica(event){
  if(event.target.selectedIndex == 0){
    document.getElementById("id_grupo").value = "";
    document.getElementById("name_grupo").value = "";
  }else{
    document.getElementById("id_grupo").value = event.target.value;
    document.getElementById("name_grupo").value = event.target.options[event.target.selectedIndex].text;
  }
}