Показать сообщение отдельно
  #1 (permalink)  
Старый 21.05.2013, 22:37
Профессор
Отправить личное сообщение для Mukhtar Посмотреть профиль Найти все сообщения от Mukhtar
 
Регистрация: 08.10.2010
Сообщений: 201

Как выбрать объект по $_GET[] переменной?
Добрый вечер. Нашел я все-таки плагин, который искал.

Там select переводится в список, после submit формы он передает переменную которая была выбрана.
Вот код
jQuery(document).ready(function(){return function(event){
var cbf = new CarBodyField("carTypes", "auto_car_grbody");
cbf.makeModelField = new CarMakeModelFields({makeSelectID: "mark", makeUrlPrefix: "mark", modelSelectID: "model", modelUrlPrefix: "model", popMakeID: "popMake", popModelsID: "popModels", grbodySelectID: "auto_car_grbody", makeListID: "makeList", modelListID: "modelList", makePanelID: "makePanel", modelPanelID: "modelPanel"});

<div style="margin-left:20px;" class="inlinePanel" id="makePanel"><div class="inlinePanel-wrap">
                <div class="togles" id="popMake"><strong><a href="#" class="flink">Марка</a></strong>
                	<select name="mark" id="mark">
                    <option value=""></option>
			<option {if $truck_mark=='BAW'} selected="selected" {/if} value="BAW">BAW</option>
			<option {if $truck_mark=='BMC'} selected="selected" {/if} value="BMC">BMC</option>
			<option {if $truck_mark=='CAMC'} selected="selected" {/if} value="CAMC">CAMC</option>
			<option {if $truck_mark=='Citroen'} selected="selected" {/if} value="Citroen">Citroen</option>
			<option {if $truck_mark=='Daewoo'} selected="selected" {/if} value="Daewoo">Daewoo</option>
			<option {if $truck_mark=='DAF'} selected="selected" {/if} value="DAF">DAF</option>
			<option {if $truck_mark=='Daihatsu'} selected="selected" {/if} value="Daihatsu">Daihatsu</option>
			<option {if $truck_mark=='Dongfeng'} selected="selected" {/if} value="Dongfeng">Dongfeng</option>
			<option {if $truck_mark=='FAW'} selected="selected" {/if} value="FAW">FAW</option>
			<option {if $truck_mark=='Ford'} selected="selected" {/if} value="Ford">Ford</option>
			<option {if $truck_mark=='Foton'} selected="selected" {/if} value="Foton">Foton</option>
			<option {if $truck_mark=='Freightliner'} selected="selected" {/if} value="Freightliner">Freightliner</option>
			<option {if $truck_mark=='Howo'} selected="selected" {/if} value="Howo">Howo</option>
			<option {if $truck_mark=='Hydrema'} selected="selected" {/if} value="Hydrema">Hydrema</option>
			<option {if $truck_mark=='Hyundai'} selected="selected" {/if} value="Hyundai">Hyundai</option>
			<option {if $truck_mark=='IFA'} selected="selected" {/if} value="IFA">IFA</option>
			<option {if $truck_mark=='Isuzu'} selected="selected" {/if} value="Isuzu">Isuzu</option>
			<option {if $truck_mark=='Iveco'} selected="selected" {/if} value="Iveco">Iveco</option>
			<option {if $truck_mark=='JAC'} selected="selected" {/if} value="JAC">JAC</option>
			<option {if $truck_mark=='Jinbei'} selected="selected" {/if} value="Jinbei">Jinbei</option>
			<option {if $truck_mark=='JMC'} selected="selected" {/if} value="JMC">JMC</option>
			<option {if $truck_mark=='Kenworth'} selected="selected" {/if} value="Kenworth">Kenworth</option>
			<option {if $truck_mark=='Kia'} selected="selected" {/if} value="Kia">Kia</option>
			<option {if $truck_mark=='Mack'} selected="selected" {/if} value="Mack">Mack</option>
			<option {if $truck_mark=='MAN'} selected="selected" {/if} value="MAN">MAN</option>
			<option {if $truck_mark=='Mazda'} selected="selected" {/if} value="Mazda">Mazda</option>
			<option {if $truck_mark=='Mercedes-Benz'} selected="selected" {/if} value="Mercedes-Benz">Mercedes-Benz</option>
			<option {if $truck_mark=='Mitsubishi'} selected="selected" {/if} value="Mitsubishi">Mitsubishi</option>
			<option {if $truck_mark=='Nissan'} selected="selected" {/if} value="Nissan">Nissan</option>
			<option {if $truck_mark=='North-Benz'} selected="selected" {/if} value="North-Benz">North-Benz</option>
			<option {if $truck_mark=='Renault'} selected="selected" {/if} value="Renault">Renault</option>
			<option {if $truck_mark=='Scania'} selected="selected" {/if} value="Scania">Scania</option>
			<option {if $truck_mark=='Shaanxi'} selected="selected" {/if} value="Shaanxi">Shaanxi</option>
			<option {if $truck_mark=='Skoda'} selected="selected" {/if} value="Skoda">Skoda</option>
			<option {if $truck_mark=='Steyr'} selected="selected" {/if} value="Steyr">Steyr</option>
			<option {if $truck_mark=='Tatra'} selected="selected" {/if} value="Tatra">Tatra</option>
			<option {if $truck_mark=='Toyota'} selected="selected" {/if} value="Toyota">Toyota</option>
			<option {if $truck_mark=='Volkswagen'} selected="selected" {/if} value="Volkswagen">Volkswagen</option>
			<option {if $truck_mark=='Volvo'} selected="selected" {/if} value="Volvo">Volvo</option>
			<option {if $truck_mark=='ГАЗ'} selected="selected" {/if} value="ГАЗ">ГАЗ</option>
			<option {if $truck_mark=='ЗиЛ'} selected="selected" {/if} value="ЗиЛ">ЗиЛ</option>
			<option {if $truck_mark=='КрАЗ'} selected="selected" {/if} value="КрАЗ">КрАЗ</option>
			<option {if $truck_mark=='КамАЗ'} selected="selected" {/if} value="КамАЗ">КамАЗ</option>
			<option {if $truck_mark=='МАЗ'} selected="selected" {/if} value="МАЗ">МАЗ</option>
			<option {if $truck_mark=='Урал'} selected="selected" {/if} value="Урал">Урал</option>
			</select><a href="catalogue?cat=auto.car&mark=Daewoo" title="Daewoo">Daewoo</a> 
                     <a href="catalogue?cat=auto.car&mark=Ford" title="Ford">Ford</a> <a href="list?cat=auto.car&mark=Volkswagen" title="Volkswagen">Volkswagen</a> 
                     <a href="catalogue?cat=auto.car&mark=Hyundai" title="Hyundai">Hyundai</a> <a href="list?cat=auto.car&mark=Isuzu" title="Isuzu">Isuzu</a> 
                     <a href="catalogue?cat=auto.car&mark=Kia" title="Kia">Kia</a> 
                     <a href="catalogue?cat=auto.car&mark=Mack" title="Mack">Mack</a> 
                     <a href="catalogue?cat=auto.car&mark=MAN" title="MAN">MAN</a> 
                     <a href="catalogue?cat=auto.car&mark=Mazda" title="Mazda">Mazda</a>
                     <a href="catalogue?cat=auto.car&mark=Toyota" title="Toyota">Toyota</a> 
                     <a href="catalogue?cat=auto.car&mark=Volvo" title="Volvo">Volvo</a>
                     </div>
                <div class="inlinePanel-data" id="makeList"></div>
            </div></div>

Как мне сделать, чтобы он выбрал ее повторно после сабмита формы?
Ответить с цитированием