Adding POST parameters before submit

前端 未结 7 896
情深已故
情深已故 2020-11-27 11:39

I\'ve this simple form:

7条回答
  •  离开以前
    2020-11-27 12:07

    To add that using Jquery:

    $('#commentForm').submit(function(){ //listen for submit event
        $.each(params, function(i,param){
            $('').attr('type', 'hidden')
                .attr('name', param.name)
                .attr('value', param.value)
                .appendTo('#commentForm');
        });
    
        return true;
    }); 
    

提交回复
热议问题