Показать сообщение отдельно
  #5 (permalink)  
Старый 30.11.2015, 19:54
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,125

ТС пропал ... остаётся гадать ...
<!DOCTYPE HTML>

<html>

<head>
  <title>Untitled</title>
  <meta charset="utf-8">
  <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">


</head>

<body>  <div id="extra_prices2" class="container alert">
  <div id="price_to_all" class="panel col-xs-12" aria-labelledby="price_to_all-tab">
    <div class="form-group">
      <div class="col-xs-4">
        <input type="text" class="form-control impact_extra_value" value="">
      </div>
      <div class="col-xs-offset-1 col-xs-4">
        <div class="input-group"> <span class="input-group-addon"><span class="initial">min</span></span>
          <input type="text" class="form-control impact_initial" value="">
        </div>
      </div>
    </div>
    <div class="form-group">
      <div class="col-xs-4">
        <input type="text" class="form-control impact_extra_value" value="">
      </div>
      <div class="col-xs-offset-1 col-xs-4">
        <div class="input-group"> <span class="input-group-addon"><span class="initial">min</span></span>
          <input type="text" class="form-control impact_initial" value="">
        </div>
      </div>
    </div>
  </div>
  <div id="price_to_client1" class="panel col-xs-12" aria-labelledby="price_to_all-tab">
    <div class="form-group">
      <div class="col-xs-4">
        <input type="text" class="form-control impact_extra_value" value="">
      </div>
      <div class="col-xs-offset-1 col-xs-4">
        <div class="input-group"> <span class="input-group-addon"><span class="initial">min</span></span>
          <input type="text" class="form-control impact_initial" value="">
        </div>
      </div>
    </div>
    <div class="form-group">
      <div class="col-xs-4">
        <input type="text" class="form-control impact_extra_value" value="">
      </div>
      <div class="col-xs-offset-1 col-xs-4">
        <div class="input-group"> <span class="input-group-addon"><span class="initial">min</span></span>
          <input type="text" class="form-control impact_initial" value="">
        </div>
      </div>
    </div>
  </div>
  <div id="price_to_client2" class="panel col-xs-12" aria-labelledby="price_to_all-tab">
    <div class="form-group">
      <div class="col-xs-4">
        <input type="text" class="form-control impact_extra_value" value="">
      </div>
      <div class="col-xs-offset-1 col-xs-4">
        <div class="input-group"> <span class="input-group-addon"><span class="initial">min</span></span>
          <input type="text" class="form-control impact_initial" value="">
        </div>
      </div>
    </div>
    <div class="form-group">
      <div class="col-xs-4">
        <input type="text" class="form-control impact_extra_value" value="">
      </div>
      <div class="col-xs-offset-1 col-xs-4">
        <div class="input-group"> <span class="input-group-addon"><span class="initial">min</span></span>
          <input type="text" class="form-control impact_initial" value="">
        </div>
      </div>
    </div>
  </div>
</div>
<script>
var extra_values_group = '{"price_to_all":{"100":"1.546","200":"2.227"},"price_to_client1":{"100":"1.007","200":"0.124"},"price_to_client2":{"100":"1.007","200":"0.124"}}',
    extra_values = JSON.parse(extra_values_group);
Object.keys(extra_values).forEach(function(a) {
    var b = document.querySelectorAll("#" + a + " input"),
        c = extra_values[a];
    Object.keys(c).forEach(function(a, e) {
        var d = 2 * e;
        b[d].value = c[a];
        b[++d].value = a
    })
});
  </script>
</body>

</html>

Последний раз редактировалось рони, 30.11.2015 в 20:39.
Ответить с цитированием