Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Daten aus Popup in unrspüngliche Seite übernehmen

Empfohlene Antworten

Veröffentlicht

Hallo zus,

Ich habe eine HTML-Seite von der aus ich ein Popup-Fenster öffne. Nun gebe ich in diesem Fenster meine Daten ein. Sagen wir einmal Name und Vorname. Nun möchte ich das Fenster wieder schliessen. Dabei sollen die Daten in die ursprüngliche HTML-Seite übernommen und angeziegt werden.

Hat jemand so was schon gemacht? Wie kann ich das bewerkstelligen? Am liebsten mit Code-Beispiel!

Danke vielmals

Gruss

einfach ein Formular machen mit target auf das eltern fenster und beim onSubmit dann mit self.close() schließen....


function submit( form) {

  form.submit();

  self.close();

}


<form action="..." method=".." target="nameDesElternFensters" onSubmit="submit()">

.

.

.

</form>

</form>

Eine Möglichkeit wäre so etwas in der Art:

Ursprungsseite:


<html>

  <head>

    <script language="JavaScript">

      function callbackFromPopup(theValue) {

        document.form1.receiverField.value = theValue;

      }

    </script>

  </head>

  <body>

    <form name="form1">

      <input name="receiverField" />

    </form>

    <input value="Popup öffnen" type="button" onclick="window.open('popup.html', '_blank')" />

  </body>

</html>


Und im Popup dann so etwas:


<html>

  <head>

    <script language="JavaScript">

      function closeMe() {

        var theValue = document.form1.valueField.value;

        opener.callbackFromPopup(theValue);

        window.close();

      }

    </script>

  </head>

  <body>

    <form name="form1">

      <input name="valueField" />

    </form>

    <input value="Schließen" type="button" onclick="closeMe()" />

  </body>

</html>

Super! Es funktioniert. Danke für eure Input's.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.