I recently moved to using <a> tags as submit buttons for styling purposes.
I have a JS plugin I wrote that handles forms and their validation.
To simulate a normal form, where a user hits enter on a text field to submit, I detect enter and submit form on keyup.
The problem is if the user hits enter in an autocomplete dropdown from Firefox, for instance, it detects and still tries to submit the form.
Any ideas? I might switch to my form handler appending a hidden submit button in the event one is not found for the form….
I simply made my validation plugin automatically look for a submit button, if one is not present, it adds it and styles it to be -9999px top and left, absolute. This way if a user hits submit, the native action is taken. I can’t just use display:none on the button or some browsers won’t fire.