Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • Last Modified:

Default Buitton when Enter Key Pressed

Hello,

I would like the form on the following page to be submitted when a user presses the enter key.  I know this should be simple (and hopefully will be!), but I simply don't seem to be able to get it to work...

The page can be seen here:

http://www.villasdirect.com

Thanks in advance.
0
Nico2011
Asked:
Nico2011
  • 2
2 Solutions
 
jpgobertCommented:
What have you tried?  

Have you tried setting the default button property in your form declaration line?

<form id="form1" class="refno" name="form1" method="post" defaultbutton="searchlocationrentals" action>
0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
It seems to work in chrome. There are some warnings in the js console although I don't think that would cause an issue.
0
 
jpgobertCommented:
Your action attribute doesn't have a value... it was like that when I copied it earlier and forgot to mention it... can you update that and test again?
0
 
Nico2011Author Commented:
Thank you both - it seems to work - not sure if all the time, but for now - fingers crossed!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now