Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So, this question has been up for about a week, and during that time I have continued to look for ideas and help.</p> <p>The solution which has presented to finest potential, but not a complete solution is via the code below:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;script&gt; function splitInput() { var x = document.forms["simpleForm02"]["dataInput_0"].value; if (x.indexOf('\t') &gt; 0) { var delimiterT = x.split('\t'); for (var i = 0; i &lt; delimiterT.length ; i++) document.getElementById("dataInput_" + i).value = (delimiterT[i]); } else if (x.indexOf('\n') &gt; 0) { var delimiterN = x.split('\n'); var j = 0; for (var i = 0; i &lt; delimiterN.length ; i++) {document.getElementById("dataInput_" + j).value = (delimiterN[i]); j += 4; } } else return false; } function classFocused() { var d = document.getElementById("dataInput_0"); d.className = d.className + " InFocus"; } function classBlured() { var d = document.getElementById("dataInput_0"); d.className = "inputArea"; } &lt;/script&gt; &lt;form name="simpleForm02"&gt; &lt;table&gt; &lt;tr&gt; &lt;th&gt;Color&lt;/th&gt; &lt;th&gt;Model&lt;/th&gt; &lt;th&gt;Qty&lt;/th&gt; &lt;th&gt;Cost&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;textarea data-id="0" class="inputArea colorInput" id="dataInput_0" name="colorInput_row_1" onFocus="classFocused();" onBlur="classBlured();" onKeyUp="splitInput();"&gt;&lt;/textarea&gt; &lt;/td&gt; &lt;td&gt; &lt;textarea data-id="1" class="inputArea modelInput" id="dataInput_1" name="modelInput_row_1" onkeyup="" &gt;&lt;/textarea&gt;&lt;/td&gt; &lt;td&gt; &lt;textarea data-id="2" class="inputArea qtyInput" id="dataInput_2" name="qtyInput_row_1" onkeyup="" &gt;&lt;/textarea&gt;&lt;/textarea&gt;&lt;/td&gt; &lt;td&gt; &lt;textarea data-id="3" class="inputArea costInput" id="dataInput_3" name="costInput_row_1" onkeyup="" &gt;&lt;/textarea&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;textarea data-id="4" class="inputArea colorInput" id="dataInput_4" name="colorInput_row_2" onkeyup="splitInput()" &gt;&lt;/textarea&gt;&lt;/td&gt; &lt;td&gt; &lt;textarea data-id="5" class="inputArea modelInput" id="dataInput_5" name="modelInput_row_2" onkeyup="" &gt;&lt;/textarea&gt;&lt;/td&gt; &lt;td&gt; &lt;textarea data-id="6" class="inputArea qtyInput" id="dataInput_6" name="qtyInput_row_2" onkeyup="" &gt;&lt;/textarea&gt;&lt;/td&gt; &lt;td&gt; &lt;textarea data-id="7" class="inputArea costInput" id="dataInput_7" name="costInput_row_2" onkeyup="" &gt;&lt;/textarea&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;textarea data-id="8" class="inputArea colorInput" id="dataInput_8" name="colorInput_row_3" onkeyup="splitInput()" &gt;&lt;/textarea&gt;&lt;/td&gt; &lt;td&gt; &lt;textarea data-id="9" class="inputArea modelInput" id="dataInput_9" name="modelInput_row_3" onkeyup="" &gt;&lt;/textarea&gt;&lt;/td&gt; &lt;td&gt; &lt;textarea data-id="10" class="inputArea qtyInput" id="dataInput_10" name="qtyInput_row_3" onkeyup="" &gt;&lt;/textarea&gt;&lt;/td&gt; &lt;td&gt; &lt;textarea data-id="11" class="inputArea costInput" id="dataInput_11" name="costInput_row_3" onkeyup="" &gt;&lt;/textarea&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>In the above example of the textarea's, if a '\t' delimiter exists then the split is made and the data is spread over the course of the data's inherit length.</p> <p>Also, in the above example of the text areas, if a '\n' delimiter exists then the split is made and the data is spread over the course of the data's inherit length vertically instead. The statement: "j += 4" is in essence the number of columns you have in the form.</p> <p>Though I still need for it to work across all text area inputs, not just the identified as ["dataInput_0"]. A jQuery $(this) identifier maybe?</p> <p>Also, the coding is limited because if you copy and paste cells which have both \t and \n, then the code doesn't work.</p> <p>But it is a step in the right direction.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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