jquery form plugin does not work when the form has inner tags

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:

  1. <form id="loginForm" action="/webservices/loginService" method="post">
  2.                     <fieldset>

  3.                         <h1 id="logo">
  4.                             <a href="#">logo</a>
  5.                         </h1>
  6.                         <div class="formular">
  7.                             <div class="formular_inner">

  8.                                 <label> <strong>Username:</strong> <span
  9.                                         class="input_wrapper"> <input name="username" type="text" />
  10.                                     </span> </label> <label> <strong>Password:</strong> <span
  11.                                         class="input_wrapper"> <input name="password"
  12.                                                                   type="password" /> </span> </label> <label class="inline"> <input
  13.                                         class="checkbox" name="" type="checkbox" value="" /> remember
  14. me on this computer </label>


  15.                                 <ul class="form_menu">
  16.                                     <li><span class="button" onclick="loginForm.submit();"><span><span>Submit</span>
  17.                                             </span><input type="submit" name="sub" value="Submit"/> </span></li>
  18.                                     <li><a href="#"><span><span>Back</span> </span> </a></li>
  19.                                     <li><a href="#"><span><span>Forgot Pass</span> </span>
  20.                                         </a></li>
  21.                                 </ul>

  22.                             </div>
  23.                         </div>
  24.                     </fieldset>
  25.                 </form>


with this script:


  1. $(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