Показать сообщение отдельно
  #21 (permalink)  
Старый 31.08.2012, 13:50
Аватар для bes
bes bes вне форума
Профессор
Отправить личное сообщение для bes Посмотреть профиль Найти все сообщения от bes
 
Регистрация: 22.03.2012
Сообщений: 3,744

вот так должно получиться
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Поиск дешевых авиабилетов</title>
  <link href="style_poisk.css" media="screen" rel="stylesheet" type="text/css" />
  <script src="http://nano.aviasales.ru/assets/autocomplete_places_ru.js?1.85.0" type="text/javascript"></script>
  <script>
    //<![CDATA[
      var LOCALE = "ru";
    //]]>
  </script>
  <script src="http://yandex.st/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="http://nano.aviasales.ru/assets/nano_ui/partners/classic_search_form_ru-2b45bd63de343458c02714e0b887b537.js" type="text/javascript"></script>
</head>
<body>
  <div id="aviasales_page-wrapper">
  <form accept-charset="UTF-8" action="http://nano.aviasales.ru/searches/new" data-uniform="" data-validator="true" data-widget="nano_search_form" id="aviasales_new_search" method="get" target="_blank"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>
    <div id="aviasales_form_contents">
	<input id="11468" name="marker" type="hidden" value="inline-form-test-marker">
      <input id="with_request" name="with_request" type="hidden" value="true" />
      <input id="currency" name="currency" type="hidden" />
      <div class="aviasales_form_line_wrapper">
        <div class="aviasales_form_input_unit aviasales_origin">
          <label for="search_params_attributes_origin_name"></label>
          <input data-clearable="require" data-validate="require" data-widget="places_autocomplete" id="search_params_attributes_origin_name" name="origin" type="text" onfocus="if(this.value=='Город вылета') this.value='';" onblur="if(this.value=='') this.value='Город вылета';" value="Город вылета" />
          <input id="origin_iata" name="origin_iata" type="hidden" />
        </div>
        <div id="aviasales_change_places">
          <div id="aviasales_change_places_bg" class="trigger" data-method="swap_places" data-swaper-to="destination,destination_iata" data-swaper-from="origin,origin_iata" data-widget="swaper"></div>
        </div>
        <div class="aviasales_form_input_unit aviasales_destination">
          <label for="search_params_attributes_destination_name"></label>
          <input data-clearable="require" data-validate="require" data-widget="places_autocomplete" id="search_params_attributes_destination_name" name="destination" type="text" onfocus="if(this.value=='Город прилета') this.value='';" onblur="if(this.value=='') this.value='Город прилета';" value="Город прилета" />
          <input id="destination_iata" name="destination_iata" type="hidden" />
        </div>
      </div>

      <div class="aviasales_form_line_wrapper">
        <div class="aviasales_form_input_unit aviasales_direct">
          <label for="search_params_attributes_depart_date"></label>
          <input data-datepicker_layout_class="small_calendar" data-datepicker_number_of_months="2" data-validate="date require" data-widget="datepicker" id="search_params_attributes_depart_date" type="text" onfocus="if(this.value=='Дата вылета') this.value='';" onblur="if(this.value=='') this.value='Дата вылета';" value="Дата вылета" style="margin-top: 18px;"/>
          <div class="aviasales_range">
		    <label for="aviasales_not_strict_dates_checkbox">± 3 дня</label>
            <input id="aviasales_not_strict_dates_checkbox" name="range" type="checkbox" value="1" />
          </div>
        </div>
        <div class="aviasales_form_input_unit aviasales_return">
          <div class="aviasales_is-direct">
		    <label for="aviasales_one_way_checkbox">Хочу обратно</label>
            <input id="aviasales_one_way_checkbox" name="oneway" type="checkbox" value="1" data-widget-disable="#search_params_attributes_return_date" />
          </div>
          <div>
            <input data-datepicker_layout_class="small_calendar" data-datepicker_number_of_months="2" data-validate="date" data-widget="datepicker" id="search_params_attributes_return_date" type="text" onfocus="if(this.value=='Обратный рейс') this.value='';" onblur="if(this.value=='') this.value='Обратный рейс';" value="Обратный рейс" />
          </div>
        </div>
      </div>

      <div class="aviasales_form_line_wrapper aviasales_count_params">
        <div class="aviasales_form_input_unit aviasales_short_labeled_select">
          <label for="adults" class="aviasales_adults_label" title="Взрослый (&gt; 12)">
            <div class="aviasales_passenger_ico">Взрослый</div>
          </label>
          <select id="search_params_attributes_adults" name="adults"><option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option></select>
        </div>
        <div class="aviasales_form_input_unit aviasales_short_labeled_select">
          <label for="children" class="aviasales_children_label" title="Ребенок (&lt; 12)" >
            <div class="aviasales_passenger_ico" style="margin-left:12px">Ребенок</div>
          </label>
          <select id="search_params_attributes_children" name="children"><option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option></select>
        </div>
        <div class="aviasales_form_input_unit aviasales_short_labeled_select">
          <label for="infants" class="aviasales_infants_label" title="Младенец (&lt; 2)" >
            <div class="aviasales_passenger_ico">Младенец</div>
          </label>
          <select id="search_params_attributes_infants" name="infants"><option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option></select>
        </div>
<div class="aviasales_form_input_unit aviasales_long_labeled_select">
<p style="position:absolute;right:90px;color:#fff;margin:5px 0;font-weight:bold;font-size: 12px;">Класс</p>
<select id="search_params_attributes_trip_class" name="trip_class"><option value="0">Эконом</option>
<option value="1">Бизнес</option>
<option value="2">Первый</option></select>
        </div>
      </div>

      <div class="input_wrapper submit">
        <input class="test" id="search_submit" name="commit" type="submit" value="Найти" />
      </div>

    </div>
  </div>
</form>

<script>
window.onload = function () {
	var inp = document.getElementById('search_params_attributes_return_date');
	var ch = document.getElementById('aviasales_one_way_checkbox');
	inp.setAttribute('disabled', 'disabled');
	inp.style.background = 'white';
	
	document.body.onclick = function (e) {
		e = e || event;
		var target = e.target || e.srcElement;
		if (target.id == 'aviasales_one_way_checkbox') {
			if (target.checked == true) {
				inp.removeAttribute('disabled');
				inp.style.background = 'lightgray';
			} else {
				inp.setAttribute('disabled', 'disabled');
				inp.style.background = 'white';
			}
		}
	}
	
}
</script>
</body>
</html>
Ответить с цитированием