Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #39266
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Painted into a corner |
| Date | 2020-12-12 10:46 +0100 |
| Organization | PointedEars Software (PES) |
| Message-ID | <1768183.tdWV9SEqCh@PointedEars.de> (permalink) |
| References | (2 earlier) <5415173.DvuYhMxLoT@PointedEars.de> <5663081.lOV4Wx5bFT@PointedEars.de> <XKqdnfj-ouveS1PCnZ2dnUU7-U_NnZ2d@westnet.com.au> <2178622.ElGaqSPkdT@PointedEars.de> <z4ednSoWJ_4QuUnCnZ2dnUU7-fPNnZ2d@westnet.com.au> |
Andrew Poulos wrote: > On 10/12/2020 3:09 am, Thomas 'PointedEars' Lahn wrote: >> […] >> and the controls of the second component by >> >> form.elements['imgWidth'][1] >> form.elements['imgGrayscaleCbx'][1] >> form.elements['imgGrayscaleRange'][1] >> >> whereas previously >> >> let form = document.forms['f-images']; > > I found that if I leave the first instance using IDs and the subsequent > instances using 'names' then > let form = document.forms['f-images']; > finds both. (This means I don't need to change my working code that uses > IDs.) This was meant to refer to *the form*, and I think there should be only one form for the same purpose for the reason that I mentioned. However if it works for the form *controls* of an “Image” component for you, so much the better. But what if the user deletes the first instance? > I didn't know that the NodeList was live. Well, I told you before :-p <news:11650524.O9o76ZdvQC@PointedEars.de> >>> Should I just clone the "Image" so that form elements exist for every >>> "Image"? (Though for 10 Images that means 1,000+ inputs added to the >>> HTML.) >> >> If this is not supposed to work without scripting anyway, and requires no >> user interaction then you should store the data in an array right away, >> and forget about form serialization. > > I'm don't understand how I supposed to store a form's data into an array > without serialising the form. Do you mean something like > const form_array = Array.from(form_data); I meant that you *could* forget that it is a form if it is *not* directly interactive. Then you would keep elsewhere the data to be submitted. >> If none of this makes sense to you, then you have to elaborate on your >> use-case. > > Thanks for the help. You’re welcome :) -- PointedEars FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix> <https://github.com/PointedEars> | <http://PointedEars.de/wsvn/> Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Painted into a corner Andrew Poulos <ap_prog@hotmail.com> - 2020-12-07 13:54 +1100
Re: Painted into a corner Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-12-07 04:25 +0100
Re: Painted into a corner Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-12-07 04:44 +0100
Re: Painted into a corner Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-12-07 19:50 +0100
Re: Painted into a corner Andrew Poulos <ap_prog@hotmail.com> - 2020-12-08 12:26 +1100
Re: Painted into a corner "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-12-08 07:07 -0800
Re: Painted into a corner Andrew Poulos <ap_prog@hotmail.com> - 2020-12-09 08:07 +1100
Re: Painted into a corner Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-12-10 17:59 +0100
Re: Painted into a corner Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-12-09 17:09 +0100
Re: Painted into a corner Andrew Poulos <ap_prog@hotmail.com> - 2020-12-12 13:01 +1100
Re: Painted into a corner Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-12-12 10:46 +0100
Re: Painted into a corner "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-12-06 19:55 -0800
Re: Painted into a corner Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-12-07 19:51 +0100
Re: Painted into a corner Julio Di Egidio <julio@diegidio.name> - 2020-12-07 02:07 -0800
csiph-web