Programming Skills
Programming Skills

Reputation: 233

Can't submit form using enter in safari browser

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 ?

Upvotes: 2

Views: 2848

Answers (2)

Evan
Evan

Reputation: 1312

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.

Upvotes: 4

JonLord
JonLord

Reputation: 817

Your example is missing a closing tag to your div:

<div class="input-group">

The invalid html being generated might be an issue?

Upvotes: 0

Related Questions