SitePoint Sponsor |
|
User Tag List
Results 1 to 10 of 10
-
Jan 29, 2008, 01:01 #1
- Join Date
- Aug 2006
- Posts
- 94
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
pressing <enter> reloads page instead of Submit form in IE
I have a simple HTML form.
In IE6, when the user enters some text and clicks enter, amazingly the page RELOADS instead of submitting the form.
Is this a bug with IE6? In Firefox there is no problem.
Is there a javascript workaround to this?
-
Jan 29, 2008, 01:54 #2
- Join Date
- Jan 2007
- Location
- Christchurch, New Zealand
- Posts
- 14,729
- Mentioned
- 104 Post(s)
- Tagged
- 4 Thread(s)
This simple test demonstrates that IE6 works properly.
Code HTML4Strict:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Test page</title> </head> <body> <form method="get" action="test.htm"> <p> <label>Name</label> <input name="name" type="text"> </p> <input type="submit"> </form> </body> </html>
So the question is, what is your code doing?Programming Group Advisor
Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
Car is to Carpet as Java is to JavaScript
-
Jan 29, 2008, 02:19 #3
- Join Date
- Aug 2006
- Posts
- 94
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I dont know, but the focus is on Submit when I am typing in text on my form, and yet when I press enter it seems to reload the page and the form is not submit. If I click the Submit button with the mouse it works fine!!!
Same problem on a colleagues PC.
-
Jan 29, 2008, 02:28 #4
- Join Date
- Jan 2007
- Location
- Christchurch, New Zealand
- Posts
- 14,729
- Mentioned
- 104 Post(s)
- Tagged
- 4 Thread(s)
Please provide a link to a page that demonstrates the non-working code.
Programming Group Advisor
Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
Car is to Carpet as Java is to JavaScript
-
Jan 29, 2008, 02:38 #5
- Join Date
- Aug 2006
- Posts
- 94
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I cant because its not published yet, but here is the code extract:
<h1>Documentation: Search Documents</h1>
<form id="docs" class="contactForm" method="post" action="http://localhost/tvvv/TI/documentation/">
<div class="gBox"><input name="language" type="hidden" value="EN (Int)" />
<p><strong>Document Type/strong></p><br/>
<div class="w90"> </div>
<div class="w90"><img src="http://localhost/tvvv/images/icons/tvvv-color-pamphlet2.gif"><input name="document_type" type="radio" value="PAM" /><br/>Color Pamphlets</div>
<div class="w90"><img src="http://localhost/tvvv/images/icons/sds.png"><input name="document_type" type="radio" value="SDS" /><br/>Specification Sheet</div>
<div class="w90"><img src="http://localhost/tvvv/images/icons/search-all.gif"><input name="document_type" type="radio" value="ANY" checked="checked" /><br/>All</div>
<div class="flush"> </div>
<p style="text-align:center"><strong>Category</strong>
<select class="select" name="catCodeXXxxxx" id="product_group">
<option value="NULL">-- All --</option>
<option value="080000">Ste</option>
<option value="090000">Con</option>
</select>
</p>
<p style="text-align:center"><strong>Keyword or Product Name</strong>:
<input name="query" type="text" value="" style="width:250px" /></p>
<p style="text-align:center;font-size:90%">
Search terms with fewer than 3 characters are ignored<br/>
Enclose groups of terms in quotes to search for phrases<br/>
Prefix terms with a plus-sign (+) to make them important<br/>
Prefix terms with a minus-sign (-) or exclamation point (!) to exclude terms</p>
<p> </p>
<p style="text-align:center"><input name="search_submit" type="submit" value="Submit" style="font-size:120%" /></p>
</div>
</form><p>Use this form to find tvvv literature. Simply select the document type you require, then optionally provide some keywords or the product category.</p>
<p>If you know the document reference number (found on the bottom of the back page of every document), or the PDF filename, you can also search for that. Alternatively, you may search for text within the document body text.</p>
<p>If you have trouble finding a specific document, please try searching the website instead by using the search box below.</p>
<form id="searchbox" action="http://localhost/tvvv/search.php?country=TI">
<h3 class="gBox">Search the entire site:
<label for="q2"><input type="text" id="q2" name="q" size="20" style="font-size:0.9em" /></label>
<input type="submit" name="btnG" value="Search tvvv.com" style="font-size:0.8em;" />
</h3>
</form>
-
Jan 29, 2008, 11:25 #6
- Join Date
- Nov 2004
- Location
- Nelson BC
- Posts
- 2,310
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Well, there's no javascript in that but if I wrap it in <html> tags and load it in browser, it exhibits normal behavior (type something in search, press enter, form submits to search.php) or (click on a radio button, hit enter, form submits to documentation/).
This is using IE7.
-
Jan 29, 2008, 12:18 #7
- Join Date
- Dec 2007
- Posts
- 66
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I also had no problem with IE6. Enter submits the form.
-
Jan 29, 2008, 17:29 #8
- Join Date
- Aug 2006
- Posts
- 94
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I have no javascript in the head or inside <body ...> or anything. Strange this is happening.
-
Jan 29, 2008, 17:39 #9
- Join Date
- Aug 2006
- Posts
- 94
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
can it be caused by CSS, maybe some kind of a
nfocus or some tag like that?
-
Jan 29, 2008, 17:43 #10
- Join Date
- Aug 2006
- Posts
- 94
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I looked at my code again and found it was a problem in the PHP that creates the html.
The form WAS actually being submitted but the post data was being skipped due to a bug in my php while cleaning input, so it appeared as if the page was just reloading.
Bookmarks