Search field (Nasa)
Sunday, January 27, 2019
11:01
<script type="text/javascript">
$(document).ready(function() {
  var execute_search = function() {
    var search_string = encodeURIComponent($('#search-field')[0].value.replace(/[^0-9A-Za-z\._\-\s]/g, ''));
    var site_url = '[link]';
    var type = encodeURIComponent('model');
    var location = site_url + '/' + search_string + '/' + type;
    if (search_string.length > 0) {
      window.location = location;
    }
  }
  $('#search-field').val($('#search_term').text()).keypress(function(e) {
    if (e.which === 13) {
      execute_search();
    }
  }).select();
  $('#search-button').click(function(e) {
    execute_search();
  });
});
</script>