Reputation: 427
how do i get an input type="submit" onclick event to fire the commitfunds.valdiate? i can't use a class or id. it must be an onclick event.
here's the code:
<?
foreach ($db->row AS $val){
$("#commitfunds<?=$val['id']?>").validate({
submitHandler: function(form){
$.post('/pages/aditorials/add_to_cart.php',
$("#commitfunds<?=$val['id']?>").serialize(), function(data) {
$('#wb_fundsresults<?=$val['id']?>').html(data);
});
}
});
<form>
<input type="text" name="commit_funds">
<input type="submit" onclick="$(#commitfunds).validate()<?=$val['id']?>;return false;">
</form>
<div id="#wb_fundsresults<?=$val['id']?>"></div>
?>
thanks
Upvotes: 1
Views: 19553