Make a radio button selected when an item select from the list
I have the following code. I have the country field in the list and the currency field in the radio button. what I want is, when I will select a country, it will automatically select the currency from the radio button. I have 3 currencies US, EUR & GBP, for EU it will be EUR, for UK it will be GBP & for the rest it will be US.
how can I do this using jquery.
please help me....
- <!DOCTYPE html>
- <html>
- <head>
- <title>Radio button and List Check</title></head>
- <body>
- <form class="form-horizontal" action="" method="post">
- <div class="form-group">
- <label class="col-sm-2 control-label" for="devices2">Country</label>
- <div class="col-sm-10">
- <select class="form-control" id="country">
- <option value="">Please select Country</option>
- <option value="US">US</option>
- <option value="EU">EU</option>
- <option value="UK">UK</option>
- <option value="China">China</option>
- <option value="India">India</option>
- <option value="Korea">Korea</option>
- <option value="Asia">Asia</option>
- <option value="Russia">Russia</option>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="devices1">Currency</label>
- <div class="col-sm-10">
- <label class="radio-inline">
- <input type="radio" name="optradio" >USD</label>
- <label class="radio-inline">
- <input type="radio" name="optradio">EUR</label>
- <label class="radio-inline">
- <input type="radio" name="optradio">GBP</label>
- </div>
- </div>
- </form>
- </body>
- </html>