PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : brauche hilfe



ccc
20-04-2004, 00:02
hi

ich habe da ein HTML file mit dem JavaScript:

http://www.barelyfitz.com/webdesign/articles/filterlist/index.php/3

ein HTML file sieht folgendermassen aus:


<HTML>
<HEAD>
<TITLE>Filterlist Example</TITLE>

<!-- Load the javascript code -->
<SCRIPT TYPE="text/javascript" SRC="filterlist.js"></SCRIPT>

</HEAD>
<BODY>
<H1>Filterlist Example</H1>

<FORM NAME="myform" ACTION="">

<SELECT NAME="myselect" SIZE=5>

<OPTION>Keanu Reeves
<OPTION>Laurence Fishburne
<OPTION>Monica Bellucci
<OPTION>Daniel Bernhardt
<OPTION>Nona Gaye
<OPTION>Lachy Hulme
<OPTION>Nathaniel Lees
<OPTION>Harry J. Lennix
<OPTION>Matt McColm
<OPTION>Carrie-Anne Moss
<OPTION>Collin Chou
<OPTION>Genevieve O'Reilly
<OPTION>Harold Perrineau Jr.
<OPTION>Jada Pinkett Smith
<OPTION>Adrian Rayment
<OPTION>Neil Rayment
<OPTION>Bruce Spence
<OPTION>Hugo Weaving
<OPTION>Lambert Wilson
<OPTION>Anthony Wong

</SELECT>

<SCRIPT TYPE="text/javascript">
<!--
var myfilter = new filterlist(document.myform.myselect);
//-->
</SCRIPT>

<P>
Filter:
<A HREF="javascript:myfilter.reset()" TITLE="Clear the filter">Clear</A>
<A HREF="javascript:myfilter.set('^A')" TITLE="Show items starting with A">A</A>
<A HREF="javascript:myfilter.set('^B')" TITLE="Show items starting with B">B</A>
<A HREF="javascript:myfilter.set('^C')" TITLE="Show items starting with C">C</A>
<A HREF="javascript:myfilter.set('^D')" TITLE="Show items starting with D">D</A>

<A HREF="javascript:myfilter.set('^E')" TITLE="Show items starting with E">E</A>
<A HREF="javascript:myfilter.set('^F')" TITLE="Show items starting with F">F</A>
<A HREF="javascript:myfilter.set('^G')" TITLE="Show items starting with G">G</A>
<A HREF="javascript:myfilter.set('^H')" TITLE="Show items starting with H">H</A>
<A HREF="javascript:myfilter.set('^I')" TITLE="Show items starting with I">I</A>
<A HREF="javascript:myfilter.set('^J')" TITLE="Show items starting with J">J</A>
<A HREF="javascript:myfilter.set('^K')" TITLE="Show items starting with K">K</A>
<A HREF="javascript:myfilter.set('^L')" TITLE="Show items starting with L">L</A>
<A HREF="javascript:myfilter.set('^M')" TITLE="Show items starting with M">M</A>

<A HREF="javascript:myfilter.set('^N')" TITLE="Show items starting with N">N</A>
<A HREF="javascript:myfilter.set('^O')" TITLE="Show items starting with O">O</A>
<A HREF="javascript:myfilter.set('^P')" TITLE="Show items starting with P">P</A>
<A HREF="javascript:myfilter.set('^Q')" TITLE="Show items starting with Q">Q</A>
<A HREF="javascript:myfilter.set('^R')" TITLE="Show items starting with R">R</A>
<A HREF="javascript:myfilter.set('^S')" TITLE="Show items starting with S">S</A>
<A HREF="javascript:myfilter.set('^T')" TITLE="Show items starting with T">T</A>
<A HREF="javascript:myfilter.set('^U')" TITLE="Show items starting with U">U</A>
<A HREF="javascript:myfilter.set('^V')" TITLE="Show items starting with V">V</A>

<A HREF="javascript:myfilter.set('^W')" TITLE="Show items starting with W">W</A>
<A HREF="javascript:myfilter.set('^X')" TITLE="Show items starting with X">X</A>
<A HREF="javascript:myfilter.set('^Y')" TITLE="Show items starting with Y">Y</A>
<A HREF="javascript:myfilter.set('^Z')" TITLE="Show items starting with Z">Z</A>

<P>

<!--
Note: if you have a very large select list,
you should deactivate the real-time filtering
on the INPUT field below - remove the onKeyUp attribute.
-->
Filter by regular expression:<BR>
<INPUT NAME=regexp onKeyUp="myfilter.set(this.value)">
<INPUT TYPE=button onClick="myfilter.set(this.form.regexp.value)" value="Filter">
<INPUT TYPE=button onClick="myfilter.reset();this.form.regexp.value=''" value="Clear">

<BR>

<INPUT TYPE=checkbox NAME="toLowerCase"
onClick="myfilter.set_ignore_case(!this.checked)">
Case-sensitive
</FORM>

</BODY>
</HTML>
ich will die ausgewählte option
via cgi (perl script) per mail schicken.

perl script selber ist es kein problem,
aber wenn ich am schluss hinfüge:

<FORM action="/cgi-bin/mail.pl" method="post">
<input type="Submit" value="senden">

dann wird perl script gar nicht ausgeführt.

Blackhawk
20-04-2004, 11:16
nimm naechstes Mal bitte eine aussagekraeftigere Ueberschrift...

bischi
20-04-2004, 15:29
Schau dir mal diesen Link an, vielleicht hilft der weiter:

http://selfhtml.teamone.de/cgiperl/intro/cgihtml.htm#wechselwirkung_html_cgi

desweiteren möchte ich mich dem mit dem ausführlicheren Titel anschliessen und noch anfügen, dass Java-Script unter Umständen problematisch sein kann.

MfG Bischi

ccc
20-04-2004, 21:42
zuerst möchte mich für den Ueberschrift entschuldigen
deutsch ist nicht meine muttersprache, habe nichts passendes gefunden
und hatte angst, dass ich nicht richtig verstanden wäre.

danke für den link, hilft aber NICHT weiter

es scheint mühe zu geben mit 2 ACTION scripten gleichzeitig in einem HTM file:
JavaScript und cgi

wenn ich

<FORM action="/cgi-bin/mail.pl" method="post">

vordem JavaScript setze, dann wird cgi script korrekt gestartet,
aber JavaScript dafür NICHT mehr.

gibt's da wirklich keine lösung ?

fork
20-04-2004, 22:54
> deutsch ist nicht meine muttersprache, habe nichts passendes gefunden
Na dann erst mal herzlich willkommen und noch viel Spass hier.

Ja es gibt nur eine ACTION pro Formular behaupte ich felsenfest ohne es wirklich zu wissen. Warum willst Du denn beides benutzen.

ccc
20-04-2004, 23:10
weil zuerst sollte etwas ausselektiert werden (javascript),
bevor man via cgi (perl) abschickt.

fork
20-04-2004, 23:43
Das mit dem aussortieren durch JS erfolgt doch dynamisch bei Änderung des Eingabefeldes für den RegEx, oder nicht?

Wenn du trotzdem irgend etwas vor der echten Submit-Aktion(hier perl) mit JS ueberpruefen willst(z. B. Plausibiltaetspruefung), bei selfhtml(hier (http://selfhtml.teamone.de/javascript/beispiele/index.htm)) in der JS-Ecke sind ein paar JS-Beispiele bei denen man das ganz gut sieht.
---
Ansonsten sehe ich gerade das Du unten einfach einen weiteren <FORM> - TAG geöffnet hast. Das öffnet ein neues Formular und hat mit dem obigen Formular nichts zu tun.

ccc
21-04-2004, 00:08
irgendwie habe hingekriegt und es scheint so zu funktionieren:

<HTML>
<HEAD>
<TITLE>Filterlist Example</TITLE>
</HEAD>
<BODY>
<!-- Load the javascript code -->
<SCRIPT TYPE="text/javascript" SRC="filterlist.js"></SCRIPT>

<FORM NAME="myform" ACTION="">

<SELECT NAME="myselect" SIZE=5>

<OPTION>Keanu Reeves
<OPTION>Laurence Fishburne
<OPTION>Monica Bellucci
<OPTION>Daniel Bernhardt
<OPTION>Nona Gaye
<OPTION>Lachy Hulme
<OPTION>Nathaniel Lees
<OPTION>Harry J. Lennix
<OPTION>Matt McColm
<OPTION>Carrie-Anne Moss
<OPTION>Collin Chou
<OPTION>Genevieve O'Reilly
<OPTION>Harold Perrineau Jr.
<OPTION>Jada Pinkett Smith
<OPTION>Adrian Rayment
<OPTION>Neil Rayment
<OPTION>Bruce Spence
<OPTION>Hugo Weaving
<OPTION>Lambert Wilson
<OPTION>Anthony Wong

</SELECT>

<SCRIPT TYPE="text/javascript">
<!--
var myfilter = new filterlist(document.myform.myselect);
//-->

<P>
Filter:
<A HREF="java script:myfilter.reset()" TITLE="Clear the filter">Clear</A>
<A HREF="java script:myfilter.set('^A')" TITLE="Show items starting with A">A</A>
<A HREF="java script:myfilter.set('^B')" TITLE="Show items starting with B">B</A>
<A HREF="java script:myfilter.set('^C')" TITLE="Show items starting with C">C</A>
<A HREF="java script:myfilter.set('^D')" TITLE="Show items starting with D">D</A>

<A HREF="java script:myfilter.set('^E')" TITLE="Show items starting with E">E</A>
<A HREF="java script:myfilter.set('^F')" TITLE="Show items starting with F">F</A>
<A HREF="java script:myfilter.set('^G')" TITLE="Show items starting with G">G</A>
<A HREF="java script:myfilter.set('^H')" TITLE="Show items starting with H">H</A>
<A HREF="java script:myfilter.set('^I')" TITLE="Show items starting with I">I</A>
<A HREF="java script:myfilter.set('^J')" TITLE="Show items starting with J">J</A>
<A HREF="java script:myfilter.set('^K')" TITLE="Show items starting with K">K</A>
<A HREF="java script:myfilter.set('^L')" TITLE="Show items starting with L">L</A>
<A HREF="java script:myfilter.set('^M')" TITLE="Show items starting with M">M</A>

<A HREF="java script:myfilter.set('^N')" TITLE="Show items starting with N">N</A>
<A HREF="java script:myfilter.set('^O')" TITLE="Show items starting with O">O</A>
<A HREF="java script:myfilter.set('^P')" TITLE="Show items starting with P">P</A>
<A HREF="java script:myfilter.set('^Q')" TITLE="Show items starting with Q">Q</A>
<A HREF="java script:myfilter.set('^R')" TITLE="Show items starting with R">R</A>
<A HREF="java script:myfilter.set('^S')" TITLE="Show items starting with S">S</A>
<A HREF="java script:myfilter.set('^T')" TITLE="Show items starting with T">T</A>
<A HREF="java script:myfilter.set('^U')" TITLE="Show items starting with U">U</A>
<A HREF="java script:myfilter.set('^V')" TITLE="Show items starting with V">V</A>

<A HREF="java script:myfilter.set('^W')" TITLE="Show items starting with W">W</A>
<A HREF="java script:myfilter.set('^X')" TITLE="Show items starting with X">X</A>
<A HREF="java script:myfilter.set('^Y')" TITLE="Show items starting with Y">Y</A>
<A HREF="java script:myfilter.set('^Z')" TITLE="Show items starting with Z">Z</A>

<P>

<!--
Note: if you have a very large select list,
you should deactivate the real-time filtering
on the INPUT field below - remove the onKeyUp attribute.
-->
Filter by regular expression:<BR>
<INPUT NAME=regexp onKeyUp="myfilter.set(this.value)">
<INPUT TYPE=button onClick="myfilter.set(this.form.regexp.value)" value="Filter">
<INPUT TYPE=button onClick="myfilter.reset();this.form.regexp.value=''" value="Clear">

<BR>

<INPUT TYPE=checkbox NAME="toLowerCase"
onClick="myfilter.set_ignore_case(!this.checked)">
Case-sensitive
</FORM>
<FORM action="/cgi-bin/mail.pl" method="post">
<input type="Submit" value="send">
</BODY>
</HTML>