Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Hitting Enter Key / Clicking button to submit form

Featured Replies

This is an annoying problem I've never fixed:

When searching, after entering their search criteria, if a visitor hits the enter key instead of clicking on the Find button it doesn't work but comes up with 'Page Cannot be Found'

I seem to remember looking at this a while back and was advised then to add a piece of code which made hitting the enter key work but stopped clicking on the 'Find All' button (which I want to keep) from working.

Is there a method of making the Enter key submit the request whilst still allowing a visior to click 'Find All' instead?

or if not,

is there a method of suppressing hitting Enter from submitting the request?

For an example of a page in question:

www.peterborough-education.org/Schools and click on 'Schools Database'

Many thanks for your help.

Add this line to your Form:

<input type="hidden" name="-findall">

All the best.

Garry

  • Author

Thanks, but I think this is what was suggested last time.

It makes the page "default" to the 'Find All' button - it's selected when the page loads - rather than the 'Search' button which does solve the problem of a 'Page cannot be found error'

*BUT DOESN'T* solve the problem of a person who types in a search criteria then hits enter - this justs performs a Find All again - they still have to actually click on the button.

The only way I managed to get it to search by hitting enter was to first type in my search, then click outside the text box so it wasn't selected (i.e. cursor wasn't flashing in it!)then hit enter!!!! Why should it only work if this is done???

There must be a solution??

http://216.168.37.92/peterb/Schools/search.htm if you want to check it out - it has the additional line.

Thanks again smile.gif

The logic is that the "name" of the "submit" tag will only be added to the submitted form if that button is clicked. The "hidden" tag will always be submitted.

Try this line instead, it may be closer to the desired procedure:

<input type="hidden" name="-find">

You could use just "-find" and some Javascript. If the search field is empty the Javascript will insert an "*". This should have the same effect as a "-findall".

All the best.

Garry

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.