Note that there are some explanatory texts on larger screens.

plurals
  1. POneed to fix html and values appending with javascript
    primarykey
    data
    text
    <p>I have a form that needs to be dynamic, allowing the user to add extra outcomes, w/ however many measures they need associated with it, as depicted here: <a href="https://i.stack.imgur.com/EMcoa.png" rel="nofollow noreferrer">http://i.stack.imgur.com/EMcoa.png</a></p> <p>Here is a sketch of the naming scheme: <a href="http://i55.tinypic.com/2s6rh4y.png" rel="nofollow noreferrer">http://i55.tinypic.com/2s6rh4y.png</a> <img src="https://i.stack.imgur.com/SukMS.png" alt="enter image description here"></p> <p>Below is the code in some form of working order: <a href="http://jsfiddle.net/bkmorse/yNZcD/2/" rel="nofollow noreferrer">http://jsfiddle.net/bkmorse/yNZcD/2/</a></p> <p>What I am having a problem with is making the name of the outcome and measure fields correct.</p> <p>I need the first outcome textarea to be named: <code>outcome[1]</code>. amd every extra outcome textarea should be <code>outcome[2], outcome[3]</code> and so on.</p> <p>As for the measure textareas, I need them be named like this: <code>measure[1][0], measure[1][1], measure[1][2]</code> and so on.</p> <p>The measure textarea's are named like that, because they will be ran thru a loop when inserted into the database, and the first index number will relate to the outcome.</p> <p>So when the user adds more measure textareas, the index should increase, for example...</p> <p>outcome[2], has measure textarea: <code>measure[2][0], measure[2][1]</code>, then when they click the plug sign, it will create a new measure textarea, named <code>measure[2][2]</code>.</p> <p>Same thing goes for when clicking the plus sign next to outcome, so the next outcome textarea name would be <code>outcome[2]</code>, click for another outcome it would be <code>outcome[3]</code> and so on.</p> <p>The code works, but I just need to have someone look at it and revise it so it has the name scheme I want.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload