jquery.form submit problem when using a link
Hello,
I use the jquery.form (v2.39) plugin with a link to call the function that will send the form. Here is the code
- <a href="javascript:submitForm();void(0)" title="Enregistrer"><img class="ro" src="/images/btn_save.gif" alt="Enregistrer"></a>
- <script>
- $(document).ready(function() {
- submitForm = function() {
- $('#formTelephone').ajaxForm(function(response) {
- if (response != '') {
- $('#error').html(response);
- }
- else {
- location.reload(true);
- }
- });
- }
});
- </script>
The problem is the form isn't submited. I have no response.
But if I call this function with this code, all is OK.
- <button class="ro ui-state-default ui-corner-all" title="Enregistrer" onclick="submitForm()"><img src="/images/btn_save.gif" alt="Enregistrer"></button>
Why can't I use a link to call the function ?
Thanks in advance