JQuery .trigger('submit') breaking

前端 未结 5 1251
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-21 09:48

Im finding that because all the forms that Im working on have a submit button which inlcudes a \'name=\"submit\"\' attribute, that the trigger submit is breaking when I clic

5条回答
  •  有刺的猬
    2020-12-21 10:40

    if you can't change your html (for example because zend form are such smartasses...)

    it's as easy as this(change the name with the javascript before trying to submit):

    $('#submit').attr('name', 'stupid_javascript');
    

提交回复
热议问题