title: Add the value to the next and previous textbox on dropdown change in html table
body: <p>I am trying to add the data value to the previous input and next input when the dropdown of the same row changes but am unable to add the value input textbox on dropdown change am using this to add the value from the sqlite as present am using a variable to add the value to the textbox . </p>
  
  <p><a href="http://jsfiddle.net/eK8X5/7257/" rel="nofollow">DEMO</a></p>
  
  <p>HTML:</p>
  
  <pre><code>   &lt;table width="100%" border="1" cellspacing="0" cellpadding="5" id="productanddates" class="border"&gt;
          &lt;tbody&gt;
              &lt;tr&gt;
                  &lt;td class="Second"&gt;
                      &lt;input type="text" name="renewal1" id="renewal1"&gt;
                  &lt;/td&gt;
                  &lt;td class="third"&gt;
                      &lt;select class="dd" name="Phonenumberdd1" id="Phonenumberdd1"&gt;
                          &lt;option value="Select"&gt;Select a Option&lt;/option&gt;
                          &lt;option value="asd"&gt;asd&lt;/option&gt;
                          &lt;option value="243"&gt;243&lt;/option&gt;
                          &lt;option value="test 1 3 "&gt;test 1 3&lt;/option&gt;
                      &lt;/select&gt;
                  &lt;/td&gt;
                  &lt;td class="forth"&gt;
                      &lt;input type="text" name="renewal_by1" id="renewal_by1"&gt;
                  &lt;/td&gt;
                  &lt;td class="fifth"&gt;
                      &lt;input type="text" name="Renivaul_to1" id="Renivaul_to1" value=""&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td class="Second"&gt;
                      &lt;input type="text" name="renewal2" id="renewal2"&gt;
                  &lt;/td&gt;
                  &lt;td class="third"&gt;
                      &lt;select class="dd" name="Phonenumberdd2" id="Phonenumberdd2"&gt;
                          &lt;option value="Select"&gt;Select a Option&lt;/option&gt;
                          &lt;option value="asd"&gt;asd&lt;/option&gt;
                          &lt;option value="243"&gt;243&lt;/option&gt;
                          &lt;option value="test 1 3 "&gt;test 1 3&lt;/option&gt;
                      &lt;/select&gt;
                  &lt;/td&gt;
                  &lt;td class="forth"&gt;
                      &lt;input type="text" name="renewal_by2" id="renewal_by2"&gt;
                  &lt;/td&gt;
                  &lt;td class="fifth"&gt;
                      &lt;input type="text" name="Renivaul_to2" id="Renivaul_to2" value=""&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td class="Second"&gt;
                      &lt;input type="text" name="renewal3" id="renewal3"&gt;
                  &lt;/td&gt;
                  &lt;td class="third"&gt;
                      &lt;select class="dd" name="Phonenumberdd3" id="Phonenumberdd3"&gt;
                          &lt;option value="Select"&gt;Select a Option&lt;/option&gt;
                          &lt;option value="asd"&gt;asd&lt;/option&gt;
                          &lt;option value="243"&gt;243&lt;/option&gt;
                          &lt;option value="test 1 3 "&gt;test 1 3&lt;/option&gt;
                      &lt;/select&gt;
                  &lt;/td&gt;
                  &lt;td class="forth"&gt;
                      &lt;input type="text" name="renewal_by3" id="renewal_by3"&gt;
                  &lt;/td&gt;
                  &lt;td class="fifth"&gt;
                      &lt;input type="text" name="Renivaul_to3" id="Renivaul_to3" value=""&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td class="Second"&gt;
                      &lt;input type="text" name="renewal4" id="renewal4"&gt;
                  &lt;/td&gt;
                  &lt;td class="third"&gt;
                      &lt;select class="dd" name="Phonenumberdd4" id="Phonenumberdd4"&gt;
                          &lt;option value="Select"&gt;Select a Option&lt;/option&gt;
                          &lt;option value="asd"&gt;asd&lt;/option&gt;
                          &lt;option value="243"&gt;243&lt;/option&gt;
                          &lt;option value="test 1 3 "&gt;test 1 3&lt;/option&gt;
                      &lt;/select&gt;
                  &lt;/td&gt;
                  &lt;td class="forth"&gt;
                      &lt;input type="text" name="renewal_by4" id="renewal_by4"&gt;
                  &lt;/td&gt;
                  &lt;td class="fifth"&gt;
                      &lt;input type="text" name="Renivaul_to4" id="Renivaul_to4" value=""&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>  $('#productanddates tr').on('change','[class="dd"]', function(e) {
        var data ="dummy data";
        $(this).prev('td input').val(data);
        $(this).next('td input').val(data);
     });
  </code></pre>