Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Damn M.I.E and its Forms! 2

Status
Not open for further replies.

iaresean

Programmer
Mar 24, 2003
570
ZA
Hello ALL!

I have a problem, I have just created a website, and I have been struggling like hell to make sure that it is compatible with all the different browsers out there.

I have been coding it in linux, and testing it mostly in Mozilla. However when I started the M.I.E testing something funny happened. I have a page with three frames, in the middle one (main frame) I have a form. When I enter in some values and hit the enter button the form is supposed to be submit, however, it just gets reset. So the only way I can send the form is by actually clicking on the submit button, or by pressing the tab key until the submit button is highlighted then press enter.

What is going on? Must I somehow specify that the default action for the enter key is to submit????

I have been using a combination of javascript/html/perl in my coding, if that helps.

Thanks for any input in this matter.
Sean.
 
Can you post a copy of your form? Please ensure that the when you post it, you wrap it with the [ignore]
Code:
...
[/ignore] tags. [thumbsup2]

Pete.


Web Developer / Aptrix CMS (LWWCM) Specialist
w: e: Pete.Raleigh(at)lclimited.co.uk
 
You want to make sure that the submit button is coded like this (to make it work the way you expect with the enter key):

Code:
<input type=&quot;submit&quot; value=&quot;Submit my form&quot; name=&quot;mySubmitButton&quot;>

If you need to send it through a function first, then you could set the form description:

Code:
<form name=&quot;myForm&quot; method=&quot;post&quot; action=&quot;javascript:myFunction()&quot;>

Hope some combination of this does the trick for you.

Jeff
 
Here is a copy of my code, hope this helps:
Code:
        <CENTER>
        <H3>$TXT{'enable_telnet_heading'}</H3><P>
                                                                                                                                                             
        <TABLE cellspacing=&quot;5&quot;>
        <form name=&quot;TelnetEnable_form&quot; method=&quot;post&quot; action=&quot;cadmin.cgi&quot;>
                <TR><TD>
                <input type=&quot;hidden&quot; name=&quot;menuoption&quot; value=&quot;5&quot;>
                </TD><TD>
                </TD></TR>
                <TR><TD>
                $TXT{'which_user_name'}
                </TD><TD>
                <input name=&quot;login&quot; type=&quot;text&quot; id=&quot;login&quot; value=&quot;$login&quot;>
                </TD></TR>
                <TR><TD></TD><TD>
                <input type=&quot;submit&quot; name=&quot;SubmitTelnet&quot; value=&quot;$TXT{'enable_telnet_button'}&quot;>
                </TD></TR>
        </form>
        </TABLE>
 
Well... I ran your code successfully with IE 6 for Windows. I typed something into the &quot;login&quot; field and pressed Return (also tested it with Enter). Worked a treat.

If you are still experiencing errors, maybe it's an issue with your test environment.

Jeff
 
Thanks Baby Jeffy,
I am gonna do a bit more research into this matter and get back to you with some results.

Sean.
 
Something you might consider (though it will probably not help with your problem) is putting a form where it belongs. <form> element cannot be placed between <table> and <tr> tag. Either wrap the whole table inside the form:
Code:
<form>
 <table>
  ...
 </table>
</form>
or put the form in one table cell only. This is illegal syntax you are using and could (though it is probably not) interfere with the funcionality.
 
If you want to suppress the extra whitespace that Vragabond's (sensible) suggestion may produce, do it like this:
[tt]
<form style=&quot;margin:0&quot;>
<table>
...
</table>
</form>
[/tt]
You could also move the <input type=hidden> outside the <table>, or into the same cell as one of the other <input>s. You don't need to display it in it's own table cell since, well, you're not going to display it at all by definition.

-- Chris Hunt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top