2

I have normal get form

<form action="{{url('/products_search')}}" method="get" class="position-relative" id="search_form">
    <div class="input-group">
        <input type="text" class="form-control search_loading" name="input_search" style="text-align: left !important;" value="{{$input_search ?? ''}}" placeholder="Find Your Products..." required>
        <button type="submit" style="display: none;"> </button>
</form>

When I hit enter in all browser it submit but in safari it doesn't work like I clicked nothing

How to make the form submit on Enter ?

jcubic
  • 61,973
  • 54
  • 229
  • 402
  • 2
    The problem may be `display: none;` try `visibility: hidden; width: 0; height: 0; overflow: hidden;` – jcubic Nov 01 '18 at 13:20

2 Answers2

4

If the button inside the form is hidden, that does not work in Safari.

You can try the solution here. https://stackoverflow.com/a/477699

It hides the button by moving it off the visible screen.

Evan
  • 1,152
  • 1
  • 11
  • 18
0

Your example is missing a closing tag to your div:

<div class="input-group">

The invalid html being generated might be an issue?

JonLord
  • 807
  • 10
  • 24
  • I just removed some codes but it works on all other browsers also missing tags won't effect the form submission – Programming Skills Sep 08 '18 at 14:41
  • 1
    Safari 11.1.2 on MacOS 10.13.6 does attempt to submit for me, pressing enter, based on your code sample above. There must be something else in your code, that I can't see. – JonLord Sep 08 '18 at 14:55