Simple jquery help!

SpaceshipSpaceship
Watch

BuLLDoG

Established Member
Impact
12
I have been following this tutorial (http://trevordavis.net/blog/ajax-forms-with-jquery/) it works perfectly. However when I change the submit button to a input type="image"... it doesn't send. It still has the id as submit. I think it has something to do with the javascript.

Would anyone know how to solve this? thanks

---------- Post added at 02:28 PM ---------- Previous post was at 02:02 PM ----------

fixed :)
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Out of curiosity, can I ask what the problem was?
 
0
•••
This should get the form to submit for you:

Code:
$(function() {
  $('#submit').click(function() {
    $(this).parents('form')
           .submit();
  });
});

The input with type of submit will submit a form when clicked the above jquery will listen to the click event on the input with id submit and then find the form element and submit it as you expected.

Cheers,

Jay
 
0
•••
wondering if anyone tried it and got it to work with;

$(function() {
$('#submit').click(function() {
$(this).parents('form')
.submit();
});
});


thanks
 
0
•••
Appraise.net

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
NameMaxi - Your Domain Has Buyers
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back