HighDots Forums  

Variable "action" in Formular

Javascript (German) Programmiersprache JavaScript. (de.comp.lang.javascript)


Discuss Variable "action" in Formular in the Javascript (German) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Erich Gysel
 
Posts: n/a

Default Variable "action" in Formular - 12-14-2007 , 08:36 AM






Hallo

in einer Formularprüfroutine erzeuge ich einen String :
.......
http="http://www.example.ch/frame.php?map=&x=' + koordx + '&y=' + koordy +
'&zl=' + zoom + '&layers=' + layers"
return http; // Rückgabewert

Dieser String soll dann im Formular die betreffende Aktion auslösen :
<form method="post" action="http" name="waplanung" onsubmit="return
formeval()">

Also mit dem String "http" soll die Aktion ausgelöst werden. So wie
angegeben funktioniert es nicht.
Leider habe ich von JS praktisch keine Ahnung.

Für einen Tipp bin ich dankbar
Es grüsst euch
Erich





Reply With Quote
  #2  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Variable "action" in Formular - 12-14-2007 , 01:13 PM






Erich Gysel wrote:
Quote:
in einer Formularprüfroutine erzeuge ich einen String :
......
http="http://www.example.ch/frame.php?map=&x=' + koordx + '&y=' + koordy +
'&zl=' + zoom + '&layers=' + layers"
return http; // Rückgabewert

Dieser String soll dann im Formular die betreffende Aktion auslösen :
form method="post" action="http" name="waplanung" onsubmit="return
formeval()"

Also mit dem String "http" soll die Aktion ausgelöst werden
Was Du vermutlich meinst und suchst, ist

function formeval(f)
{
// ...
f.action = "http://...";
// ...
return ...
}

<form ... onsubmit="return formeval(this);">

Quote:
So wie angegeben funktioniert es nicht.
Natürlich nicht. Der Attribut*wert* hat nichts mit einem möglichen
Variablenbezeichner oder einer Eigenschaft des Globalen Objekts, und der
Rückgabewert des Event-Listeners nichts mit dem action-Attribut des
form-Elements zu tun. Vielmehr definiert der Rückgabewert, ob das Formular
abgesendet werden soll (`true') oder nicht (`false').

Quote:
Leider habe ich von JS praktisch keine Ahnung.
Schlechte Voraussetzungen, um hier präsentierte Lösungen/Erklärungen zu
verstehen.


PointedEars
--
Bedenke, daß Mozilla bereits 4 Jahre alt ist. Du kannst Dir also ausrechnen,
wie veraltet NN4 ist. Trotzdem ist er der erfolgreichste Browser aller
Zeiten. Kein Fossil ist je so alt geworden wie dieser Browser einen aussehen
läßt. ;-) -- Georg Maaß in dcljs <aouobi$q4qm6$1 (AT) ID-3551 (DOT) news.dfncis.de>


Reply With Quote
  #3  
Old   
Erich Gysel
 
Posts: n/a

Default Re: Variable "action" in Formular - 12-15-2007 , 06:09 AM



Hallo

"Thomas 'PointedEars' Lahn" <PointedEars (AT) web (DOT) de> schrieb im Newsbeitrag
news:4762D5EE.3040804 (AT) PointedEars (DOT) de...
Quote:
Was Du vermutlich meinst und suchst, ist

function formeval(f)
{
// ...
f.action = "http://...";
// ...
return ...
}

form ... onsubmit="return formeval(this);"
Danke, der Ansatz ist vielversprechend, aber irgendwo noch falsch.
Vielleicht hast du mir nochmals einen Tipp. Ich habe :
<form name="waplanung" onsubmit="return formeval(this);">

function formeval(f)
{
//..

http = 'http://www.mapplus.ch/frame.php?map=&x=' + koordx + '&y=' + koordy +
'&zl=' + zoom + '&layers=' + layers;
alert(http);

f.action = 'http://www.mapplus.ch/frame.php?map=&x=' + koordx + '&y=' +
koordy + '&zl=' + zoom + '&layers=' + layers;

return ;
}

Setze ich den String zusammen, dann würde bei "http" der richtige String für
die "action" erzeugt !

bei "f.action" aber ein falscher.
http://www.mapplus.ch/frame.php?koor...ON&bergseen=ON

Danke für deine Hilfe
Es grüst dich
Erich




Reply With Quote
  #4  
Old   
Erich Gysel
 
Posts: n/a

Default Re: Variable "action" in Formular - 12-16-2007 , 01:43 AM



Fehler gefunden !
Nochmals besten Dank !
Gruss Erich



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.