Jump to content

Enter doesn't submit button in IE


Bogey

Recommended Posts

Hi all,

 

This is the code:

<form action="/login.php" method="post"><p><input type="text" class="" name="username" placeholder="Email" /><input type="password" class="" name="password" placeholder="Password" /><input type="submit" class="button_login" name="btn_login" id="btn_login" value=""/></p></form>

Chrome works fine! But IE:

 

When pushing ENTER in IE after filled in the PASSWORD, then form doesn't submit.

Searching made me find out its because there is only one textbox in form. More than one textbox should go further.

 

But I want only ONE textbox.

 

I did try it with a hidden textbox, but couldn't make it happen.

 

Any ideas?

Edited by Bogey
Link to comment
Share on other sites

Try removing the slash in the action and make sure you have a login.php. Also, why the <p>?

 

Edit:

 

Seems to work for me.

Edited by niche
Link to comment
Share on other sites

Doesn't work for me :s

 

The slash I always use in HTML, to start from the root (so when page with the link moves to another directory the action still is valid). Not a wise thing to do?

(I tried it without the slash, but did not help)

 

The login.php is there! ;)

 

The <p> is cause I have bought a template. The use the <p> there and style it in css.

Link to comment
Share on other sites

What happens when you just run the snippet in your OP? That's what I did and it seemed like it would work (got a missing file message, but that was expected). Could be something else in the template.

Edited by niche
Link to comment
Share on other sites

I think it has to be with one of these lines in a pk.js file... any clues?

Sorry for the many line, but I already brought it back from just under 900 line to 175 lines ;)

(also a lot of comments in there! :glare: )

jQuery.noConflict(); jQuery(document).ready(function(){ jQuery("#options_wrapper").pk_options_menu();}); /*  * PK_OPTIONS_MENU ****/ function closeOptionsMenu() {jQuery("#options_wrapper div").filter(":visible").stop().slideUp(400, function() {jQuery("#options_wrapper").hide();});} (function($) {$.fn.pk_options_menu = function(options) {var defaults = {controls: "#options_menu li",easing: "easeOutExpo",speedIn: 400,speedOut: 100} var settings = $.extend({}, defaults, options); /**/ return this.each(function() {var $root = $(this);var $menu = $(settings.controls);var $items = $("div", $root);var $new_item = null; $root.hide(); $menu.each(function(i) {$(this).hoverIntent(function() {$new_item = $items.filter(":eq(" + i + ")"); if($new_item.css("display") == "none") {if($root.css("display") == "none") {$root.show();$items.filter(":visible").slideUp(0);$new_item.slideDown(settings.speedIn);} else {$items.filter(":visible").slideUp(settings.speedOut, function() {$new_item.slideDown(settings.speedIn);});}$new_item.bind("mouseleave", function() {closeOptionsMenu();});}}, function(){});});});};})(jQuery); /*  * END PK_CODE ****/ /*** hoverIntent is similar to jQuery's built-in "hover" function except that* instead of firing the onMouseOver event immediately, hoverIntent checks* to see if the user's mouse has slowed down (beneath the sensitivity* threshold) before firing the onMouseOver event.* * hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+* <http://cherne.net/brian/resources/jquery.hoverIntent.html>* * hoverIntent is currently available for use in all personal or commercial * projects under both MIT and GPL licenses. This means that you can choose * the license that best suits your project, and use it accordingly.* * // basic usage (just like .hover) receives onMouseOver and onMouseOut functions* $("ul li").hoverIntent( showNav , hideNav );* * // advanced usage receives configuration object only* $("ul li").hoverIntent({* sensitivity: 7, // number = sensitivity threshold (must be 1 or higher)* interval: 100,   // number = milliseconds of polling interval* over: showNav,  // function = onMouseOver callback (required)* timeout: 0,   // number = milliseconds delay before onMouseOut function call* out: hideNav    // function = onMouseOut callback (required)* });* * @param  f  onMouseOver function || An object with configuration options* @param  g  onMouseOut function  || Nothing (use configuration options object)* @author    Brian Cherne <brian@cherne.net>*/(function($) {$.fn.hoverIntent = function(f,g) {// default configuration optionsvar cfg = {sensitivity: 7,interval: 100,timeout: 200};// override configuration options with user supplied objectcfg = $.extend(cfg, g ? { over: f, out: g } : f ); // instantiate variables// cX, cY = current X and Y position of mouse, updated by mousemove event// pX, pY = previous X and Y position of mouse, set by mouseover and polling intervalvar cX, cY, pX, pY; // A private function for getting mouse positionvar track = function(ev) {cX = ev.pageX;cY = ev.pageY;}; // A private function for comparing current and previous mouse positionvar compare = function(ev,ob) {ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);// compare mouse positions to see if they've crossed the thresholdif ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {$(ob).unbind("mousemove",track);// set hoverIntent state to true (so mouseOut can be called)ob.hoverIntent_s = 1;return cfg.over.apply(ob,[ev]);} else {// set previous coordinates for next timepX = cX; pY = cY;// use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );}}; // A private function for delaying the mouseOut functionvar delay = function(ev,ob) {ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s = 0;return cfg.out.apply(ob,[ev]);}; // A private function for handling mouse 'hovering'var handleHover = function(e) {// next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOutvar p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } }if ( p == this ) { return false; } // copy objects to be passed into t (required for event object to be passed in IE)var ev = jQuery.extend({},e);var ob = this; // cancel hoverIntent timer if it existsif (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } // else e.type == "onmouseover"if (e.type == "mouseover") {// set "previous" X and Y position based on initial entry pointpX = ev.pageX; pY = ev.pageY;// update "current" X and Y position based on mousemove$(ob).bind("mousemove",track);// start polling interval (self-calling timeout) to compare mouse coordinates over timeif (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );} // else e.type == "onmouseout"} else {// unbind expensive mousemove event$(ob).unbind("mousemove",track);// if hoverIntent state is true, then call the mouseOut function after the specified delayif (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}}}; // bind the function to the two event listenersreturn this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
Edited by Bogey
Link to comment
Share on other sites

Finally got it working!

<form action="login.php" method="post" id='formLOGIN'><input type="text" name="username" placeholder="Email"/><input type="password" name="password" placeholder="Password" onkeyup="if (event.keyCode == 13) document.getElementById('formLOGIN').submit()"/><input type="submit" class="button_login" name="btn_login" id="btn_login" value=""/></form>
Edited by Bogey
Link to comment
Share on other sites

I also tried the hidden field / button tag / value / and a lot more....

But the solution in my post before this post was the first and only thing that made it work like I wanted...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...