Re: Dynamic JS Form Variables



In a contingent reality, Colin Fine possibly said:

When I've done this, it's never occurred to me to try and use the same
names for the inputs in the new rows as the existing rows: I've always
generated distinct names for each input.
I can see it would be easier to process it the way you are doing it: are
we sure that it works to add further inputs with the same names as
existing ones?

Thanks for the other replies; it was a stupid, stupid problem that was
fixed after much trial and error. Apparently, Javascript does not like
forms to be contained within <div> tags outside of where it has control.

To answer your question, it works perfectly. Since I am storing the values
in an array, dynamically created portions of the form simply append to the
same array. When you can have up to 200-300 lines of entry, it's a lot
easier to keep track of them all with one variable name as opposed to
several hundred.
.



Relevant Pages

  • Re: Checking if a list of names appears in a body of text.
    ... have you considered a decision tree built from your list of company names? ... an array intersection, but this is problematic for two-word company ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Clearing Arrays
    ... Colin wrote: ... > If I 'push' data from a database into an array to look/manipulate the data ... > and then using the same array name, 'push' data into the array from another ...
    (perl.beginners)
  • Re: Declaring an array of List Generic Class elements
    ... "colin" wrote: ... I am declaring an element like this: ... I would like to declare an array of this myList. ... When you're defining the array, you aren't constructing the Listobjects, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: array -> query
    ... Colin Fine wrote: ... $datay = array( ... I want to change it to query format. ... that you have some implicit structure in your array, ...
    (comp.lang.php)
  • Re: Pulling variables from str_replace
    ... In a contingent reality, Blayde possibly said: ... than one string unless you make a huge array for the search and replace ...
    (comp.lang.php)