jquery - form not sending data in ajax.serialize when form contents are updated via javascript -
jquery - form not sending data in ajax.serialize when form contents are updated via javascript -
i facing problem when using javscript update inner html of form. want dynamically add together input type same name in form , send form info via jquery ajax serialize. eg.
class="snippet-code-js lang-js prettyprint-override">function addinput() { //update form html add together next <input type="text" value="1" name="addtext" /> <input type="text" value="2" name="addtext" /> <input type="text" value="3" name="addtext" /> <input type="text" value="4" name="addtext" /> <input type="text" value="5" name="addtext" /> } function initiate() { document.myform.action="initiatemultiplereceiptreceiptaction.action?next=0"; var formdata=$('form[name$="myform"]').serialize(); }
class="snippet-code-html lang-html prettyprint-override"><a href="javascript:addinput()">click add together more</a> <form id="myform" action="initiate();"> <input type="submit" value="submit" /> </form>
now problem formdata not showing $addtext value
javascript jquery html ajax
Comments
Post a Comment