click, submit and submitHandler from validation plugin
Hello,
I'm new in js/jquery, and I have a question I can't solved yet.
I have some page with lot of forms (20 per page), this forms are always the same, because is for reply comments directly in these page. (like wordpress comment manage page).
The forms id are: commentresponder-XXXX (XXXX = comment id).
I'm getting lot of problem handled individually each form.
I don't use submit button, i have a link which do submit function.
Into <form..></form> the link look like:
- <a id="fbotonsendcom-XXXX" class="boton" href="#">responder</a>
XXXX, another time is the comment id.
Now these click functionallity:
- $("[id^=fbotonsendcom-]").click(function(event) {
- event.preventDefault();
- var idElement = $(this).attr("id");
- var aidElement = idElement.split('-');
- var idComment = aidElement[1];
- $('#commentresponder-' + idComment).submit();
- });
When i use alert() to see the id of the form it give me undefined for:
- var idElement = $(this).attr("id");
I used the var with parent() too, up 5 parents without results, always say "undefined".
So my questions is... Cand i pass the id from click function to the validation submitHandler plugin ?
something like...
- $('#commentresponder-' + idComment).submit('id=' idComment);
Any other recomendation is wellcome.
Thanks and regards.