Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get value from one textbox and assign to next coming textbox
    text
    copied!<p>I am trying to get the textbox value and trying to assign next coming text field.<img src="https://i.stack.imgur.com/jAHYs.png" alt="enter image description here"></p> <p>Just like in image ,when i try to add some value to my second textfield (like 260 ) it will fill the next (kashif first textfield in example) field with the previous field value.This will work after the second field entry and so one.Nothing for the first. Name and id are dynamically generated like for the first it will be size_min[1_1_0]( for 240) and size_max[1_1_0] (for 260).I am confuse due to dynamic ids of the field. This is my html code :</p> <pre><code> &lt;div class="entry-edit"&gt; &lt;div class="entry-edit-head"&gt; &lt;h4 class="icon-head"&gt;&lt;?php echo Mage::helper('mymodule')-&gt;__($value['label']." (".$std['name'].")") ?&gt;&lt;/h4&gt; &lt;/div&gt; &lt;div&gt; &lt;div id="addanswer_form" class="fieldset"&gt; &lt;?php $results = $read-&gt;fetchAll("select * from mytable where standards_id =".$std['standards_id']); foreach($results as $mykey=&gt;$myvar) { ?&gt; &lt;div class="hor-scroll" style=" margin-bottom: 2px; "&gt; &lt;div style=" width:70px; float:left;"&gt; &lt;label for="name" &gt;&lt;?php echo ucwords($myvar['value']);?&gt; &lt;/label&gt; &lt;/div&gt; &lt;div style=" float:left;"&gt; &lt;input type="text" class="required-entry input-text required-entry" style=" float:left; width:60px;" value="" name="size_min[&lt;?php echo $value['dimension_id']."_".$std['standards_id']."_".$myvar['value_id']?&gt;]" id="size_min[&lt;?php echo $value['dimension_id']."_".$std['standards_id']."_".$myvar['value_id']?&gt;]"&gt; &lt;/div&gt; &lt;span style="float:left;"&gt; &amp;nbsp;&amp;nbsp;- &amp;nbsp;&amp;nbsp;&lt;/span&gt; &lt;div style=" float:left;"&gt; &lt;input type="text" class="required-entry input-text required-entry" style=" float:left; width:60px;" value="" name="size_max[&lt;?php echo $value['dimension_id']."_".$std['standards_id']."_".$myvar['value_id']?&gt;]" id="size_max[&lt;?php echo $value['dimension_id']."_".$std['standards_id']."_".$myvar['value_id']?&gt;]" &gt; &lt;/div&gt; &lt;/div&gt; &lt;?php } // end of foreach loop for standard values ?&gt; &lt;/div&gt; </code></pre> <p><strong>This is output in html formate:</strong></p> <pre><code>&lt;div class="fieldset" id="addanswer_form"&gt; &lt;div style=" margin-bottom: 2px; " class="hor-scroll"&gt; &lt;div style=" width:70px; float:left;"&gt; &lt;label for="name"&gt;Neemh&lt;/label&gt; &lt;/div&gt; &lt;div style=" float:left;"&gt; &lt;input type="text" id="size_min[1_1_7]" name="size_min[1_1_7]" value="" style=" float:left; width:60px;" class="required-entry input-text required-entry"&gt; &lt;/div&gt; &lt;span style="float:left;"&gt; &amp;nbsp;&amp;nbsp;- &amp;nbsp;&amp;nbsp;&lt;/span&gt; &lt;div style=" float:left;"&gt; &lt;input type="text" id="size_max[1_1_7]" name="size_max[1_1_7]" value="" style=" float:left; width:60px;" class="required-entry input-text required-entry"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div style=" margin-bottom: 2px; " class="hor-scroll"&gt; &lt;div style=" width:70px; float:left;"&gt; &lt;label for="name"&gt;Kashif&lt;/label&gt; &lt;/div&gt; &lt;div style=" float:left;"&gt; &lt;input type="text" id="size_min[1_1_8]" name="size_min[1_1_8]" value="" style=" float:left; width:60px;" class="required-entry input-text required-entry"&gt; &lt;/div&gt; &lt;span style="float:left;"&gt; &amp;nbsp;&amp;nbsp;- &amp;nbsp;&amp;nbsp;&lt;/span&gt; &lt;div style=" float:left;"&gt; &lt;input type="text" id="size_max[1_1_8]" name="size_max[1_1_8]" value="" style=" float:left; width:60px;" class="required-entry input-text required-entry"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div style=" margin-bottom: 2px; " class="hor-scroll"&gt; &lt;div style=" width:70px; float:left;"&gt; &lt;label for="name"&gt;Shamma&lt;/label&gt; &lt;/div&gt; &lt;div style=" float:left;"&gt; &lt;input type="text" id="size_min[1_1_10]" name="size_min[1_1_10]" value="" style=" float:left; width:60px;" class="required-entry input-text required-entry"&gt; &lt;/div&gt; &lt;span style="float:left;"&gt; &amp;nbsp;&amp;nbsp;- &amp;nbsp;&amp;nbsp;&lt;/span&gt; &lt;div style=" float:left;"&gt; &lt;input type="text" id="size_max[1_1_10]" name="size_max[1_1_10]" value="" style=" float:left; width:60px;" class="required-entry input-text required-entry"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
 

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