|
|||
|
Hallo Community,
ich komme einfach nicht weiter und hoffe Ihr könnt mir helfen. Es geht um eine Ajax Suche mit Dropdown Hier mein bisheriger Code: ajax.php PHP-Code:
Code:
$(function() {
$('#hersteller').change(function(){
$.ajax({
url: ('ajax.php'),
data: 'id=' + $(this).val(),
type: 'GET',
timeout: 2000,
dataType: 'json',
error: function() {
alert('Error loading json data!');
},
success: function(json){
var output = '';
for (p in json) {
output += '<option value=\"' + json[p].oV + '\">' + json[p].oT + '</option>\n';
}
$('#typ').html(output);
}
})
});
});
HTML-Code:
{literal}
<script type="text/javascript" src="script.js"></script>
{/literal}
<label for="hersteller">Hersteller</label>
<select name="hersteller" id="hersteller">
<option value="all">- alle -</option>
<option value="1">Herrsteller 1</option>
<option value="2">Herrsteller 2</option>
<option value="3">Herrsteller 3</option>
</select>
<label for="typ">Typ</label>
<select name="typ" id="typ">
<option value="all">- alle -</option>
</select>
Den Produkten wurden noch zusätzliche Infos mitgegeben die durch diese suche gefiltert werden sollen. Mein Problem ist nun das ich keine Daten aus der DB erhalte egal was ich bisher angestellt habe es kam nichts an . Vielleicht stehe ich ja auch nur auf dem Schlauch ! EDIT: Fehlermeldungen gibt es nur die eine "Error loading json data" Bitte um Hilfe. greets |
![]() |
| Lesezeichen |
| Stichworte |
| ajax, dropdown, problem, suche |
| Themen-Optionen | |
| Ansicht | |
|
|
Ähnliche Themen
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Suche Erweiterte Suche Bringt Problem :/ | Oi Ben | Shopbereich | 9 | 13.04.2005 11:57 |