jquery form plugin does not work when the form has inner tags
Hi guys,
I have tried the jquery form plugin as in the examples and it worked pretty well.
Then I tried to handle the following form:
-
- <form id="loginForm" action="/webservices/loginService" method="post">
- <fieldset>
- <h1 id="logo">
- <a href="#">logo</a>
- </h1>
- <div class="formular">
- <div class="formular_inner">
- <label> <strong>Username:</strong> <span
- class="input_wrapper"> <input name="username" type="text" />
- </span> </label> <label> <strong>Password:</strong> <span
- class="input_wrapper"> <input name="password"
- type="password" /> </span> </label> <label class="inline"> <input
- class="checkbox" name="" type="checkbox" value="" /> remember
- me on this computer </label>
- <ul class="form_menu">
- <li><span class="button" onclick="loginForm.submit();"><span><span>Submit</span>
- </span><input type="submit" name="sub" value="Submit"/> </span></li>
- <li><a href="#"><span><span>Back</span> </span> </a></li>
- <li><a href="#"><span><span>Forgot Pass</span> </span>
- </a></li>
- </ul>
- </div>
- </div>
- </fieldset>
- </form>
with this script:
- $(document).ready(function() { $('#loginForm').ajaxForm({ beforeSubmit: function(a,f,o) { alert('Submitting...'); }, datatype: "json", success: function(result){ alert(result); } //success });//ajaxForm });
Unfortunately when the form contains inner tags the plugin does not work and there are no errors in the js console.
Can anybody help me to sort this problem out?
Cheers,
Fabrizio