Seite 1 von 1

Map Mod - location ins profile_add_body übergeben

Verfasst: 07.11.2007 17:57
von phillip
Hallo

Code: Alles auswählen

Ich bin grad verzweifelt dran, beim Koordinatensuchen gleich den Ort mit ins profile_add_body zu geben.

Ich hab dies einmal folgendermassen versucht:

function refresh_place(place)
{
	separator_coord=place.indexOf("_");
	separator_location=place.indexOf("@");
	longitude=place.substr(0,separator_coord);
	latitude=place.substring(separator_coord+1,separator_location);
	user_location=place.substr(separator_location+1,100);

	opener.document.forms['user'].longitude.value = longitude;
	opener.document.forms['user'].latitude.value = latitude;
	[b]opener.document.forms['user'].use = location;[/b]
	

	if (opener.document.forms['user'].location) {
		if (opener.document.forms['user'].location.value == "") {
			opener.document.forms['user'].location.value = user_location;
		}
	}
	
	opener.focus();
	window.close();
}
da ich noch nicht besonders viel übung in javascript habe, will ich her einmal um Hilfe bitten ;-)


Hier die map_search.tpl vereinfacht:

Code: Alles auswählen


<form method="post" name="search_place" action="{S_SEARCH_ACTION}">

{L_COUNTRY} <select name="country">
<option value="{search_enabled.country.ID}" {search_enabled.country.SELECTED}>{search_enabled.country.NAME}</option>

</select>{L_LOCATION} <input type="text" name="search_place" value="{PLACE}" class="post" />

<input type="submit" name="search" value="{L_SEARCH}" class="liteoption" />

{L_UPDATE_PLACE}<select name="place_list">{S_PLACE_OPTIONS}</select>
<input type="submit" class="liteoption" onClick="refresh_place(this.form.place_list.options[this.form.place_list.selectedIndex].value);return false;" name="use" value="{L_SELECT}" />

</form>


Re: Map Mod - location ins profile_add_body übergeben

Verfasst: 08.11.2007 00:02
von Pyramide

Code: Alles auswählen

if (opener.document.forms['user'].location) {
	if (opener.document.forms['user'].location.value == "") {
		opener.document.forms['user'].location.value = user_location;
	}
}
Der Code sorgt doch schon dafür, daß der Ort aus dem Popup in das Profil-Formular übertragen wird. Oder was meinst du?

Verfasst: 08.11.2007 17:07
von phillip
ja das hab ich mir auch gedacht...
aber es macht irgendwie wenig sinn, hier heissts user_location.
und ich will ja, dass der eingegebene Ort ins profile_add_body "hüpft", also wie die Koordinaten.

Und im Profile_add_body heisst der name einfach 'location'.

Verfasst: 12.11.2007 17:49
von phillip
kann mir niemand helfen?