473,320 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Enter doesn't act on form when cursor is on a drop down

dlite922
1,584 Expert 1GB
Hi guys,

Quick question.

If I have a submit button (image type), and submits the form when I press enter from a text field, it should also work when the focus is on a select box?

I'm running into that issue, just wanted to ask before I start debugging.



Dan
Dec 18 '09 #1
1 1731
dlite922
1,584 Expert 1GB
confirmed: it doesn't work.

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html>
  3. <body>
  4.  
  5. Test Enter Key While Select Box is Focused:<br />
  6.  
  7. <form action="" method="post" name="test">
  8.  
  9. <input type="text" name="testText" value="Hi"/>
  10. <br /><br />
  11. <select name="testSelect">
  12.     <option value="1">One</option>
  13.     <option value="2">Two</option>
  14.     <option value="3">Three</option>
  15. </select>
  16. <br /><br />
  17. <input type="submit" name="submit" value="Submit"/>
  18. </form><br />
  19.  
  20. <?php
  21. if(@$_POST['testSelect']) echo "<h2>Submited</h2>"; 
  22. ?>
  23.  
  24. </body>
  25. </html>
  26.  
I have to use JavaScript and capture the enter key and submit the form and set all the settings (ie reset page num to 1, etc)...too much hassle for me. If the user is tabbing through or clicking, they can get to the Submit button.




Dan
Dec 18 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Kevin Blount | last post by:
I'm playing with dragable <DIV>s, being inspired by google.com/ig, where you can move items on the page around and have items you move over change position if necessary. I have 3 div's setup,...
11
by: Sandra Castellanos | last post by:
Hello, I want to know what I have to do to make the enter key to submit forms. I read in another newsgroup that inserting an html hidden text box made the trick, and it actually does, but in my...
6
by: guoqi zheng | last post by:
In a regular html form, when user press "enter" key, the form will be submitted. However, in ASP.NET web form, a form will only be submitted (post back) when a special button is clicked. Many...
18
by: Colin McGuire | last post by:
Hi - this was posted last weekend and unfortunately not resolved. The solutions that were posted almost worked but after another 5 days of working on the code everynight, I am not further ahead....
15
by: Adam J. Schaff | last post by:
I have noticed that if a user closes a form via pressing return (either while the OK button has focus or if AcceptButton is set to OK for the form) then the "ENTER" keypress event fires ON THE...
0
by: roxanaislam | last post by:
Hi: I have a search form in my application which has 4 dropdown list controls, one text box, one "GO" button, one "reset" button. When the "GO" button is clicked the form gets submitted and the...
4
by: roxanaislam | last post by:
Submitting Form by pressing the "ENTER" key -------------------------------------------------------------------------------- Hi: I have a search form in my application which has 4 dropdown...
4
by: nkoier | last post by:
Hi, I've been going crazy trying to figure out what's wrong with our Asp.Net 2.0 intranet site. At the very top of our main page I provide a TextBox and a Button for submitting Google searches....
2
by: namratha247 | last post by:
Hi, Can anybody please help me with this problem. In my application, I'm using Menus. and the CSS for the menu is as given below ccMenu.css /* Root = Horizontal, Secondary = Vertical */...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.