We help IT Professionals succeed at work.

IE8 Submit Form with [Enter] Key, not functioning properly

Hello All;

There is a problem (Bug) with IE8, that needs to be squashed.

OK.
This is my Search Form (below in code view)

When using FF and Chrome. and your search for the term    kiss
You get:
Main.asp?Type=Results&Term=kiss&Submit=Images

BUT
With IE8, when you do the same search, you only get
Main.asp?Type=Results&Term=kiss

You are missing the
&Submit=Images

How can I get IE8 to brab the rest of the Form fields on pressing the [Enter] key?

As mentioned, this works great in FF and Chrome, but not in IE8

Thank You
Carrzkiss
<form action="">
<input class="SField" type="hidden" name="Type" value="Results" />
<table style="text-align:left; vertical-align:top;">
<tr>
  <td style="border:1px #000000 dotted;">Search Term</td>
  <td style="border:1px #000000 dotted;"><input name="Term" type="text" tabindex="1" /></td>
</tr>
<tr><td colspan="3" style="border:1px #000000 dotted;">
Search <input class="SField" type="submit" name="Submit" value="Images" tabindex="2"  /></td>
</tr>
</table>
</form>

Open in new window

Comment
Watch Question

CEO at tagfa.com
Commented:
Hi
to fix this problem you must use a hidden field and send your data with this.
usually submit key value not need

Commented:
<input class="SField" type="submit" name="Submit" value="Images" tabindex="2" />

What is this meant to be?

As alirezasaberi says if you want the term &Submit=images to be sent to the server then the type must be hidden. In which case the tabindex="2" is superfluous. If it is meant to be a submit buttom with the legend images on the button face, then it doesn't need a name attribute nor will it get sent to the server. If it is meant to be a field, preset with the word images, which the user can edit before being sent to the server then the type attribute must be text.

Question: why does the hidden field named "Type" have a class attribute? It's hidden, so there is nothing to display?

Question: Why does the field named "Submit" also have a class attribute?
Wayne BarronAuthor, Web Developer
Top Expert 2009

Author

Commented:
I totally missed that.
I think I need more sleep :)

I always do my hidden fields for my search, and just flat right out forgot about this one.

Thank you
Carrzkiss
Wayne BarronAuthor, Web Developer
Top Expert 2009

Author

Commented:
@BigRat.
I have no idea, why I added the class to the hidden field.
It was a simple mistake, and is removed from the actual code.

Submit has a class attribute because it shares the the CSS information with the field properties. There for it has a class which gives it a different color and font type.

tabindex
<input class="SField" type="submit" name="Submit" value="Images" tabindex="2"  />
This is the Submit button, there for it has a Tabindex of 2
There is another Submit button that has a tabindex of 3 that I did not include here, as it was not needed for the question.

So. To clearify everything
I got rid of the class on the hidden field, as it was added in when I was applying my class to my fields and was a simple mistake for it being there. It happens you know?

The Submit button needs to class and the tabindex, as it is a Submit button itself and not hidden.

I added in the hidden field for the Submit=Image
So that is taken care of as well, and everything works like it should.

Funny how Google Chrome and FF both will work without the hidden attribute but IE8 will not??? Another issue (or) big within IE8

Take Care all;
Carrzkiss
Wayne BarronAuthor, Web Developer
Top Expert 2009

Author

Commented:
I just caught onto something
@BigRat
>>Question: Why does the field named "Submit" also have a class attribute?

Have you never used css with Submit buttons before?

Example

<input type="submit" name="Submit" value="Submit Me" style="background-color:#000000; color:FFFFFF;" />

This will give the button a "Black" Color with "White" Font.

Any field that is visible can have a CSS styling added to it, to fit the page design.
This is what is really cool about CSS.

Just wanted to add this in to this 3 month old question.

Carrzkiss