Hi list

Long 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="../../assets/jquery.js"></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="../../images/btAdicionar.gif" width="94" height="16" alt="subit 
form" /></button>
    </form>
    <div id="edit_response"></div>

TIA
Marcelo Wolfgang

Reply via email to