I am having the otp form which needs to pass the value from table td values to four different input field. I want the solution for this ?I have already done passing that but the value is passing even though the input is null it seems when i submits.number should not be visible when press the td.but in place star should be visible after entering the number.

```js
$("#tblMain  tbody td").on('click', function() {
    if($("#empname").val()==="") {
      $("#empname").val($(this).text());
    } else {
    if($("#empname2").val()==="") {  
      $("#empname2").val($(this).text());
    } else {
    if($("#empname3").val()==="") {  
      $("#empname3").val($(this).text());
    } else {
    if($("#empname4").val()==="") {  
      $("#empname4").val($(this).text());
    } } } }
});
$("#backspace").on('click', function() {

   document.getElementById("empname").value="";
   document.getElementById("empname2").value="";
  document.getElementById("empname3").value="";
  document.getElementById("empname4").value="";
  });
```

```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form>
<table align="center" id="tblMain" border="1" style="cursor: pointer;">
  <tr>
    <td>1</td>
    <td>2</td>
    <td>3</td>
    <td>4</td>
  </tr>
  <tr>
    <td>5</td>
    <td>6</td>
    <td>7</td>
    <td>8</td>
  </tr>
  <tr>
    <td>9</td>
    <td>0</td>
    <td>*</td>
    <td id="backspace">back</td>
  </tr>

 </table>

<input type="text" id="empname" value=""/>
<input type="text" id="empname2" value=""/>
<input type="text" id="empname3" value=""/>
<input type="text" id="empname4" value=""/>
<button type="submit" class="btn btn-info btn-xl-8" id="otp_submit" >Submit OTP</button>
</form>
```

Could you please anyone help on this?