Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Jquery Mobile forms do not call onsubmit in Internet Explorer 7 #2993

Closed
dgregg opened this Issue · 11 comments

4 participants

@dgregg

I have a simple page (below) that does not call the onsubmit event when I click the submit button in IE7. Submit works in all other browsers (IE8, Firefox, Chrome, Safari ...) - not in IE7. Submit works in IE7 with regular JQuery but breaks with JQuery mobile. The simple form below should alert "submitting" when the form is submitted, then cancel the form submission.

<!DOCTYPE html>

<html>

<head>

<title></title>

<link href="http://code.jquery.com/mobile/latest/jquery.mobile.min.css" rel="stylesheet"
type="text/css" />

<script src="http://code.jquery.com/jquery-1.6.4.min.js&quot;&gt;&lt;/script>

<script src="http://code.jquery.com/mobile/latest/jquery.mobile.min.js&quot;&gt;&lt;/script>

</head>

<body>



<!-- Start of first page -->

<div data-role="page" id="login" data-theme="c">



<div data-role="header" data-theme="b" id="hdrMain" name="hdrMain" data-nobackbtn="true">

<h1></h1>

</div><!-- /header -->



<div data-role="content" id="contentMain" name="contentMain">

<div class="round">

<form id="form1" method="post" action='' onsubmit='alert("submitting");return
false;'>

<div id="tidDiv" data-role="fieldcontain">

<label for="tid" id="tidLabel" name="tidLabel">Username</label>

<input id="tid" name="TID" type="text" />

<label for="pwd" id="pwdLabel" name="pwdLabel">Password</label>

<input id="pwd" name="PWD" type="password" />

<label for="dmd" id="dmnLabel" name="dmnLabel">Domain</label>

<input id="dmd" name="DMD" type="text" />

</div>

<input type="submit" data-theme="b" name="submit" value="Login" />

<!--Login</button-->

</form>

</div>



</div><!-- /content -->





</div><!-- /page one -->





</body>

</html>

@eddiemonge

You really shouldnt be using inline JS. Also, try naming your submit button something else like "send".

@eddiemonge

@dgregg Can you also copy that code to a test page at jsbin please?

@dgregg

This is merely a test page. I had inline JS and when it did not work I decided to go as simple as possible. That is when I discovered that IE 7 was ignoring my submit function call, no matter what form I put it in.

@dgregg dgregg closed this
@dgregg dgregg reopened this
@eddiemonge

Could you try this example: http://jsbin.com/ihujus/2 ? I dont have IE7 handy

@dgregg
@ghost

same problem here but with IE8
this bug isnt fixed yet: #2001

when is JQM fully supporting jquery 1.7 ??

@jaspermdegroot
Collaborator

@dgregg @xchrix

Can you confirm this is still an issue?
If you use data-role="none" to have a native submit buttom, does the problem still occur or not?

@jaspermdegroot
Collaborator

@Wilto

I assume this is a duplicate of #2743 but wait for confirmation (I guess if data-role="none" solves it, it is a duplicate)

@Wilto Wilto was assigned
@dgregg
@jaspermdegroot
Collaborator

@dgregg - Thanks for the response!

Closing this issue as duplicate of #2743.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.