Jquery Validation on link that have a "onclick function"
hi,
this is my first post on jquery forum.
i have a form, that send with a link, not with a classic submit button.
jquery validation plugin work, but the problem is that the link have also a "onclick function".
when i click the link "#carica", if the validation is OK, the form information are sended, but the "onclick" function doesn't work.
this is the code:
- <form id="singularDemo" enctype="multipart/form-data">
- <p>Immagine</p><div id="single"></div><br/>
- <p>Nome Prodotto</p>
- <input type="input" name="nome" id="nome"/>
- </form><br/>
- <a href="javascript:;" id="carica" onClick="document.getElementById('agileUploaderSWF').submit();">Carica</a>
the Jquery code:
- $(function () {
- $('#carica').click(function(e) {
- e.preventDefault();
- /* $("#agileUploaderSWF").submit();*/
- $("#singularDemo").submit();
- });
- $("#singularDemo").validate(
- {
- rules:
- {
- nome: "required",
- },
- messages:
- {
- nome: " Inserisci il tuo nome!",
- }
- }
- );
- });
help me, please!
thanks a lot.
Lorenzo
ps sorry for my bad english!