You are not logged in.

  • Login

Dear visitor, welcome to Coder Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, March 6th 2009, 11:48am

Probleme mit Jquery-Autocomplete im IE

Hallo Leute,

ich würde gerne den JQuery Autocompleter benutzen der hier im Wiki beschrieben ist: http://www.coder-wiki.de/HowTos/Ajax-Autocomplete-jQuery
Funktioniert eigentlich ganz gut ... wenn da mal nicht wieder der IE wäre! :cursing:

Habe folgende Formularfelder die ich mit JQuery vervollständigen möchte:
Land
Region 1
Region 2
Region 3
Region 4
Stadt

das seltsame ist nur, dass es bei den Feldern Region 1-4 funktioniert und bei Land und Stadt nicht.
Bei Land und Stadt (im IE 6+7) blinken die Ergebnisse ganz kurz auf und verschwinden dann wieder.
Die Ausgabe der Regionen machen keine Probleme. Im FF funktioniert übrigens alles Bestens.
Habe nun schon einige Stunden gegooglet und mein Code mehrfach geprüft - alles ohne Ergebnisse!
Kann mir bitte einer von euch weiter helfen?

Hier mein Quellcode:

HTML Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Neues Land erstellen</title>
<script type="text/javascript" src="../script/jquery/jquery.js"></script>
<script type="text/javascript" src="../script/jquery/jquery.autocomplete.js"></script>
<style type="text/css">
.ac_results {
	padding: 0px;
	border: 1px solid WindowFrame;
	background-color: Window;
	overflow: hidden;
}
 
.ac_results ul {
	width: 100%;
	list-style-position: outside;
	list-style: none;
	padding: 0;
	margin: 0;
}
 
.ac_results iframe {
	display:none;/*sorry for IE5*/
	display/**/:block;/*sorry for IE5*/
	position:absolute;
	top:0;
	left:0;
	z-index:-1;
	filter:mask();
	width:3000px;
	height:3000px;
}
 
.ac_results li {
	margin: 0px;
	padding: 2px 5px;
	cursor: pointer;
	display: block;
	width: 100%;
	font: menu;
	font-size: 12px;
	overflow: hidden;
}
 
.ac_loading {
	background : Window url('images/loading.gif') right center no-repeat;
}
 
.ac_over {
	background-color: Highlight;
	color: HighlightText;
}
</style>
 
<script type="text/javascript">
function selectItem(li)
{
	return false;
}
function formatItem(row)
{
	return row[0] + " <i>" + row[1] + "</i>";
}
$(document).ready(function(){
	$("#id_country").autocomplete("land-jquery.php?spalte=country&",{ 
		minChars:1
	});
});
$(document).ready(function(){
	$("#id_region1").autocomplete("land-jquery.php?spalte=region1&",{ 
		minChars:1
	});
});
$(document).ready(function(){
	$("#id_region2").autocomplete("land-jquery.php?spalte=region2&",{ 
		minChars:1
	});
});
$(document).ready(function(){
	$("#id_region3").autocomplete("land-jquery.php?spalte=region3&",{ 
		minChars:1
	});
});
$(document).ready(function(){
	$("#id_region4").autocomplete("land-jquery.php?spalte=region4&",{ 
		minChars:1
	});
});
$(document).ready(function(){
	$("#id_city").autocomplete("land-jquery.php?spalte=city&",{ 
		minChars:1
	});
});
</script>
 
</head>
<body>
	<form method="post" action="">
		<table border="0" cellspacing="2" cellpadding="2">
			<tr>
				<td align="right">Land*:</td>
				<td><input id="id_country" type="text" name="country"<?php if(isset($error_country)) { echo " class=\"textfeldererror\""; } ?> style="width:350px;" /></td>
			    <td>zB. Deutschland </td>
			</tr>
			<tr>
				<td align="right">Region 1*:</td>
				<td><input type="text" name="region1" id="id_region1"<?php if(isset($error_region1)) { echo " class=\"textfeldererror\""; } ?> style="width:350px;" /></td>
			    <td>zB. Bayern </td>
			</tr>
			<tr>
				<td align="right">Region 2:</td>
				<td><input type="text" name="region2" id="id_region2"<?php if(isset($error_region2)) { echo " class=\"textfeldererror\""; } ?> style="width:350px;" /></td>
			    <td>zB. Niederbayern </td>
			</tr>
			<tr>
				<td align="right">Region 3:</td>
				<td><input type="text" name="region3" id="id_region3"<?php if(isset($error_region3)) { echo " class=\"textfeldererror\""; } ?> style="width:350px;" /></td>
			    <td>zB. Straubing </td>
			</tr>
			<tr>
				<td align="right">Region 4:</td>
				<td><input type="text" name="region4" id="id_region4"<?php if(isset($error_region4)) { echo " class=\"textfeldererror\""; } ?> style="width:350px;" /></td>
			    <td>&nbsp;</td>
			</tr>
			<tr>
				<td align="right">PLZ*:</td>
				<td><input type="text" name="zip" id="id_zip"<?php if(isset($error_zip)) { echo " class=\"textfeldererror\""; } ?> style="width:150px;" /></td>
			    <td>&nbsp;</td>
			</tr>
			<tr>
				<td align="right">Stadt*:</td>
				<td><input type="text" name="city" id="id_city"<?php if(isset($error_city)) { echo " class=\"textfeldererror\""; } ?> style="width:350px;" /></td>
			    <td>zB. Mariaposching </td>
			</tr>
			<tr>
				<td align="right">Gebiet:</td>
				<td><input type="text" name="area" id="id_area"<?php if(isset($error_area)) { echo " class=\"textfeldererror\""; } ?> style="width:350px;" /></td>
			    <td>&nbsp;</td>
			</tr>
			<tr>
				<td align="right">Lat*:</td>
				<td><input type="text" name="lat" id="id_lat"<?php if(isset($error_koordinaten)) { echo " class=\"textfeldererror\""; } ?> style="width:150px;" /></td>
			    <td>&nbsp;</td>
			</tr>
			<tr>
				<td align="right">Lng*:</td>
				<td><input type="text" name="lng" id="id_lng"<?php if(isset($error_koordinaten)) { echo " class=\"textfeldererror\""; } ?> style="width:150px;" /></td>
			    <td>&nbsp;</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
				<td><input type="submit" name="Submit" value="Speichern" /><input name="action" type="hidden" value="1" /></td>
			    <td>&nbsp;</td>
			</tr>
		</table>
	</form>
</body>
</html>


ach ja, ein beispiel findet ihr hier: http://www.kmd-test.de/fewo/admin/test.php

Grüße KMD

This post has been edited 1 times, last edit by "KMD" (Mar 6th 2009, 12:05pm)


2

Friday, March 6th 2009, 2:42pm

Probier mal nur einmal Document Ready zu nutzen.
Vielleicht kommt der IE damit sonst nicht klar.

JavaScript Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<script type="text/javascript">
function selectItem(li)
{
	return false;
}
function formatItem(row)
{
	return row[0] + " <i>" + row[1] + "</i>";
}
 
$(document).ready(function(){
	$("#id_country").autocomplete("land-jquery.php?spalte=country&",{ 
		minChars:1
	});
	$("#id_region1").autocomplete("land-jquery.php?spalte=region1&",{ 
		minChars:1
	});
	$("#id_region2").autocomplete("land-jquery.php?spalte=region2&",{ 
		minChars:1
	});
	$("#id_region3").autocomplete("land-jquery.php?spalte=region3&",{ 
		minChars:1
	});
	$("#id_region4").autocomplete("land-jquery.php?spalte=region4&",{ 
		minChars:1
	});
	$("#id_city").autocomplete("land-jquery.php?spalte=city&",{ 
		minChars:1
	});
});
</script>

3

Friday, March 6th 2009, 2:57pm

Hi vince,

danke für deine Antwort, hat aber leider nicht geholfen! Ich verzweifle bald... ;(

4

Sunday, March 8th 2009, 1:16pm

Der Wiki Beitrag ist inzwischen leider etwas veraltet. Ich muss ihn unbedingt mal aktualisieren.
Hast du mal die Version von jQuery UI probiert?

Beispiel und Code hier: http://docs.jquery.com/UI/Autocomplete

5

Monday, March 9th 2009, 1:53pm

Welche jQuery Version hast du?
Was sagt Firebug?

6

Monday, March 9th 2009, 8:23pm

Beispiel und Code hier: http://docs.jquery.com/UI/Autocomplete


Das wird nicht viel bringen, da die Funktion aus der UI wieder rausgeflogen ist.
Die kommt erst ab April oder Mai mit Version 1.8 oder 1.9

Social bookmarks