Thanks a mix between the button type="button" and the tip about my form
beeing submit before the ajax help me figure out what was the problem. Ryan wrote: My question has been hijacked with another! :)On Dec 6, 4:36 pm, "Jake McGraw" <[EMAIL PROTECTED]> wrote:Perhaps try <button type="button" ...> instead of <button type="submit" ...>. Haven't tested, but it looks like maybe your form is trying to submit before the AJAX gets a chance to resolve. - jake On Dec 6, 2007 1:53 PM, Marcelo Wolfgang <[EMAIL PROTECTED]> wrote:Hi listLong time lurker, first time poster, so here it goes:I have a simple form that call a $.get, if I have a <input type="button"> my code works but if I have a <button></button> it doesn't ... can anyone tell me what I'm doing wrong? here's the code:<script type="text/_javascript_" src=""></script> <script type="text/_javascript_"> $(document).ready(function(){ $("#btSubmit").click(function () { var id = $("#user_id").val(); var number2 = $('#number2').attr('value'); $.get("a_edit.php", { userid: id, number2: number2 }, function(data){ alert("Data Loaded: " + data); $("#edit_response").append(data); }); }); }); </script>and the html that works<form> <input type="hidden" name="user_id" id="user_id" value="10" /> <input type="button" id="btSubmit" value="=" /> </form> <div id="edit_response"></div>and the html that don't work:<form> <input type="hidden" name="user_id" id="user_id" value="10" /> <button type="submit" id="btSubmit"><img src="" width="94" height="16" alt="subit form" /></button> </form> <div id="edit_response"></div>TIA Marcelo Wolfgang |
- [jQuery] Show/Hide Div with checkbox options providing sa... Ryan
- [jQuery] Re: Show/Hide Div with checkbox options pro... Glen Lipka
- [jQuery] Re: Show/Hide Div with checkbox options... Ryan
- [jQuery] Re: Show/Hide Div with checkbox opt... Glen Lipka
- [jQuery] Re: Show/Hide Div with checkbox... Ryan
- [jQuery] Re: Show/Hide Div with che... Glen Lipka
- [jQuery] Re: Show/Hide Div with... Glen Lipka
- [jQuery] Can figure out the diference between in... Marcelo Wolfgang
- [jQuery] Re: Can figure out the diference be... Jake McGraw
- [jQuery] Re: Can figure out the diferenc... Ryan
- [jQuery] Re: Can figure out the dif... Marcelo Wolfgang