Показать сообщение отдельно
  #3 (permalink)  
Старый 30.11.2015, 19:39
Профессор
Отправить личное сообщение для Mess4me Посмотреть профиль Найти все сообщения от Mess4me
 
Регистрация: 03.11.2014
Сообщений: 263

SeeJ,
так?
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
    <style>
    </style>
</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);
    for(var fKey in extra_values) {
        if($('#' +fKey)) {
            var nObj = extra_values[fKey];
            
            for(var key in nObj){
                $('#' +fKey).find('.impact_extra_value').val(nObj[key]);
                $('#' +fKey).find('.impact_initial').val(key);

            }
        }   
            
             
    }



</script>


</body>

</html>
Ответить с цитированием