How Can I Get All The Data From A Summited Form And Make That Into A New List July 28, 2023 Post a Comment I want to take all the data submitted and make it into a list ( -item: bannana -itemNum: #3330...) Item:Solution 1: just one line:let formInputs = Object.fromEntries( newFormData(myForm).entries() ) Copysee FormData in context:Baca JugaHow Do I Select A Key/value Pair By Finding The Smallest Value In A Number Of Key/value Pairs In A Javascript Object?Array Length With Key-value, JsHow Do I Append A File To Formdata()?myForm = document.querySelector('#myForm') myForm.onsubmit = evt => { evt.preventDefault() // disable submit page reloadconsole.clear() let formInputs = Object.fromEntries( newFormData(myForm).entries() ) console.log( formInputs ) }Copybody, textarea, input { font-family : Helvetica, Arial sans-serif; font-size : 12px; } label { font-size : 1.2em; display : block; float : left; clear : both; width : 10em; white-space : nowrap; overflow : hidden; font-weight : bold; padding-top : .7em; line-height: 1.4em; } label:after { content : '....................................'; font-weight : normal; color : lightslategray; } input { display : block; float : left; width : 5em; margin : .3em; } button { display : block; float : left; clear : both; margin-top : .6em; } .as-console-wrapper { max-height:100%!important; top:0; left:50%!important; width:50%; } .as-console-row { background-color: yellow; } .as-console-row::after { display:none !important; }Copy<formid="myForm"action=""><label> Item:</label><inputname="item"type="text" ><label> Item numbers:</label><inputname="itemNum"type="number" ><label> Quantity:</label><inputname="quantity"type="number" ><label> Price:</label><inputname="price"type="number" ><label> Discount:</label><inputname="discount"type="number" ><buttontype="submit">Submit</button></form>Copy Share You may like these postsRedux-form : Triggerring Onchange Event On Fireld Based On Another Button ClickHow To Add Form With In Another Form Using Ajax? But Remember First Form Is Also Added With AjaxChecking Password OnsubmitJquery Methods: Difference Between .submit() Vs .trigger('submit') Post a Comment for "How Can I Get All The Data From A Summited Form And Make That Into A New List"
Post a Comment for "How Can I Get All The Data From A Summited Form And Make That Into A New List"