Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript onclick change the value of the second input box to be the same as the value of the first input box
    primarykey
    data
    text
    <p>I am creating a form using php. One of my field I created a six rows of drop down box with the same two option 'Floating Rate' and 'Fixed Rate' to select and also a button at the side of each drop down box. I want to make it easier for the user to select. For example if the user select 'Floating Rate' on the first row and click on the button at the side, the rest of the rows will change its selection to 'Floating Rate'. And if the user select either options on the 4th row, the 5th and the 6th row will change according to the option the user choose on the 4th row. I'm a noobie to Java or Jquery. Is there a way to achieve the above result using Javascript?</p> <p>1st Row:</p> <pre><code>&lt;td&gt; &lt;select class="dropDown" style="width:150px" name="rate_value_1"&gt; &lt;option value="&lt;?php echo $_SESSION['rate_value_1'] ;?&gt;"&gt;&lt;?php echo $_SESSION['rate_value_1'] ;?&gt;&lt;/option&gt; &lt;option value="Floating Rate"&gt;Floating Rate&lt;/option&gt; &lt;option value="Fixed Rate"&gt;Fixed Rate&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;td&gt;&lt;input type="button" value="equal" class="equal" /&gt;&lt;/td&gt; </code></pre> <p>2nd Row:</p> <pre><code>&lt;td&gt; &lt;select class="dropDown" style="width:150px" name="rate_value_2"&gt; &lt;option value="&lt;?php echo $_SESSION['rate_value_2'] ;?&gt;"&gt;&lt;?php echo $_SESSION['rate_value_2'] ;?&gt;&lt;/option&gt; &lt;option value="Floating Rate"&gt;Floating Rate&lt;/option&gt; &lt;option value="Fixed Rate"&gt;Fixed Rate&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;td&gt;&lt;input type="button" value="equal" class="equal" /&gt;&lt;/td&gt; </code></pre>
    singulars
    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.
 

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