Codeproblem Button

  • PHP

  • Cyberloner
  • 1070 Aufrufe 8 Antworten

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Codeproblem Button

    Hilfe, ich habe mit einem PHP Script folgendes Problem:

    <input type="submit" name="send" value="{txt_submit}">

    Gibt derzeit nach Klick des Buttons das Ergebnis auf der selben Seite aus.

    Ich möchte jedoch, dass die Buttonseite unverändert bleibt und der Klick auf den Button nur bewirkt, dass sich die Ergebnisseite in einem definierbaren Popup öffnet.

    Ich kann mir gerade nicht vorstellen, wie man das Formular deaktivieren soll und bzw. oder zusätzlich von einem Submit Button ein neues Fenster öffnet.

    Weiß jemand Rat? :confused:
  • Kein Problem.
    Undzwar kommt folgender Teil zwischen <head> und </head> des html teils:

    HTML-Quellcode

    1. <script language="Javascript">
    2. function popup(theURL,winName,features) {
    3. window.open(theURL,winName,features);
    4. }
    5. </script>


    Und nun zu deinem Formular.
    Da wo <input type="submit" name="send" value="{txt_submit}"> steht ... muss einige Zeilen folgendes kommen.
    <form action.... o.Ä. auf jedem fall etwas mit <form....
    das editierst du wie folgt:

    HTML-Quellcode

    1. <form action="datei.php" onSubmit="popup('datei.php','dateiname','width=720,height=300,scrollbars=yes')" target="dateiname">


    Hoff es hilft dir.
    mortician
    [size=1][FONT="Courier New"]###############_###_####_
    #_ __ #___ _ _| |_(_)__(_)__ _ _ _###############new uploads: [1] [2] [3] [4] [5] [6] [7] [8]
    |#'##\/ _ \ '_|##_| / _| / _` | ' \
    |_|_|_\___/_|##\__|_\__|_\__,_|_||_|###############Bis 28. Sept. weg[/FONT][/size]
  • Moinsen...

    Du fängst ja in dem formular folgend an:

    <form action="ziel.php" method="post">
    <input type="submit" value="SENDEN">
    </form>

    Nun kannst du bei action einen link reinbasteln so wie du ihn brauchst um ein PopUp zu öffnen... zB:

    actiom="window.open(url,'name','height=400,width=200');"

    so long...
    rave

  • actiom="window.open(url,'name','height=400,width=2 00');"


    Das wird 100%ig nicht funktionieren.
    Hab es naemlich auch vorhin versucht :D.
    Das was ich vorhin geschickt hab muesste klappen.
    [size=1][FONT="Courier New"]###############_###_####_
    #_ __ #___ _ _| |_(_)__(_)__ _ _ _###############new uploads: [1] [2] [3] [4] [5] [6] [7] [8]
    |#'##\/ _ \ '_|##_| / _| / _` | ' \
    |_|_|_\___/_|##\__|_\__|_\__,_|_||_|###############Bis 28. Sept. weg[/FONT][/size]
  • Danke für Eure Hinweise.

    Irgendwie klappt das aber nicht so ganz.

    Hier mal der Orginalcode. Wie muß ich den editieren, damit es wie gewünscht klappt?

    PHP-Quellcode

    1. <form name="vote" action="{script_self}" method="post">
    2. <table width="130" cellpadding="5" cellspacing="0" style="border:1px solid #646464; background-color:#FFFFFF;">
    3. <tr>
    4. <td colspan="5" style="color:#FFFFFF; background-color:#FF898C; border-bottom:1px solid #FFFFFF;"> {vote_text} </td>
    5. </tr>
    6. <tr>
    7. <td style="padding-top:5px; padding-bottom:10px;">
    8. {vote_form_fields}
    9. </td>
    10. </tr>
    11. <tr>
    12. <td style="background-color:#FF898C; text-align: center; padding-bottom: 0px">
    13. <input type="submit" name="send" value="{txt_submit}">
    14. </td>
    15. </tr>
    16. <tr>
    17. <td style="background-color:#FF898C; text-align: center; padding-top: 0px">
    18. <a href="#" onClick="window.open('{document_self}?result=true','','width=282,height=220,resizable=NO,scrollbars=NO,menubar=NO,toolbar=NO')" title="Aktueller Votingstand"><b>{txt_display_results}</B></a>
    19. </td>
    20. </tr>
    21. </tr>
    22. </table>
    23. </form>
    Alles anzeigen
  • HTML-Quellcode

    1. <form name="vote" action="datei.php" onSubmit="window.open('datei.php','datei','width=282,height=220,resizable=NO,scrollbars=NO,menubar=NO,toolbar=NO')" method="post" target="datei">
    2. <table width="130" cellpadding="5" cellspacing="0" style="border:1px solid #646464; background-color:#FFFFFF;">
    3. <tr>
    4. <td colspan="5" style="color:#FFFFFF; background-color:#FF898C; border-bottom:1px solid #FFFFFF;"> {vote_text} </td>
    5. </tr>
    6. <tr>
    7. <td style="padding-top:5px; padding-bottom:10px;">
    8. {vote_form_fields}
    9. </td>
    10. </tr>
    11. <tr>
    12. <td style="background-color:#FF898C; text-align: center; padding-bottom: 0px">
    13. <input type="submit" name="send" value="{txt_submit}">
    14. </td>
    15. </tr>
    16. <tr>
    17. <td style="background-color:#FF898C; text-align: center; padding-top: 0px">
    18. <a href="#" onClick="window.open('{document_self}?result=true','','width=282,height=220,resizable=NO,scrollbars=NO,menubar=NO,toolbar=NO')" title="Aktueller Votingstand"><b>{txt_display_results}</B></a>
    19. </td>
    20. </tr>
    21. </tr>
    22. </table>
    23. </form>
    Alles anzeigen


    Nun muss die Ausgabe des Formulars aber auch in der datei.php (so hab ich sie genannt, kannst du ja ändern), stattfinden.
    Hoff es klappt :D.
    mortician
    [size=1][FONT="Courier New"]###############_###_####_
    #_ __ #___ _ _| |_(_)__(_)__ _ _ _###############new uploads: [1] [2] [3] [4] [5] [6] [7] [8]
    |#'##\/ _ \ '_|##_| / _| / _` | ' \
    |_|_|_\___/_|##\__|_\__|_\__,_|_||_|###############Bis 28. Sept. weg[/FONT][/size]