I have run into a problem with our javascript. I have two buttons. When a certain input has a value, we hide the button, otherwise, we show it.

Here are the buttons we want to hide and show:

```
<button class="btn btn-info" style="visibility: hidden;" type="button" id="button1" data-id="{{receiptno}}" data-toggle="modal" data-target="#myModal" contenteditable="false">Pay</button>
<form action="/payments/report/{{receiptno}}.pdf" method=post>
  <input type=hidden value="{{receiptno}}" name="row_print"></input>
  <button class="btn btn-danger" style="visibility: hidden;" type="submit" id="anotherbutton1" name="delete">
      <span class="glyphicon glyphicon-print"></span> Print Receipt
  </button>      
</form>

```

We are getting our value here. If it's '' we show the **pay** button, else we show the **print receipt** button:

```
<input style="visibility: hidden;" id="referto" value="{{paymentmethod}}">

```

Here's our javascript:

```
<script type="text/javascript">
  $(document).ready(function() {
    console.log($("#referto").val());
    if ( $("#referto").val() == '') { 
      document.getElementById('button1').style.visibility = 'visible';
    }
    else {
      document.getElementById('anotherbutton1').style.visibility = 'visible';
    }   
  });    
</script>

```

I'm really not sure why this isn't working. Any help is appreciated. Thank you!