javascript - Clicking submit button does nothing using jquery delegate -


i trying use form in website loaded through javascript (from results of ajax call), submit button calls delegate function sends ajax call.

this works in chrome , ie, in firefox clicking button nothing, there no javascript errors or either.

14/04/2014 edit: has started happening in chrome well, after no changes code

the form built:

tr += "<form  method='post' data-opid='"+resultarr[i].columns.number+"'       class='update_form' action='' name='form"+resultarr[i].columns.number+"'>";  tr += "<td><input type='submit' class='update' value='update'></td></form>"; 

and delegate function starts:

jquery(document).delegate(".update_form", "submit", function(e){    alert("in delegate"); 

but alert never triggers in firefox.

i have <a class='displayopp' href='../partner_detail/view/" + resultarr[i].columns.internalid.internalid + "'> uses jquery(document).delegate(".displayopp", "click", function(e){ perfectly.

i have been looking see if there firefox issues delegate have been unable find anything. have noticed form loaded javascript pressing "enter" submit wont work, other im not sure look. pointers appreciated.

i have attempted minimise code relevant information, file 500 lines long (for various reasons im not happy with), let me know if havent provided enough information.

as mentioned earlier problem in firefox, else works fine.

i found error, , wasn't in code gave sorry. form declared:

<table>     <tr>         <form>             <td>form input</td>             <td>form input</td>             <td>form submit</td>         </form>     </tr> </table> 

i changed be:

<form>     <table>         <tr>             <td>form input</td>             <td>form input</td>             <td>form submit</td>         </tr>     </table> </form> 

and works!

once knew problem found page stated

tables , forms can nested either way. if put forms tables, each form must included single table cell (one td element in practice). thereby forms each independent.

so order issue, , ie , chrome work because awesome, dont want ie continued work cos awesome, wont it.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -