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.

Empfohlene Antworten

Veröffentlicht

Hallo Leute,

folgendes Problem:

von einer select-Feld aus möchte ich bei onchange-Aktion einen Wert übermitteln mit einer Funktion:

fSend('kunde')

<script>

function fSend(s) {

stringIndex = document.forms[0].''+s+''.selectedIndex;

}

</script>

wie binde ich "s" ein, damit ich den selectedIndex abfragen kann??

In meinem Beispiel ist es falsch. Habe schon mit einem String versucht, aber das hilft mir ja auch nicht weiter.

Ich könnte per Funktion mit schon den selectedIndex übermitteln lassen, aber ich habe mehrere select-Felder und deswegen sollte es allgemein gehalten werden. Muss ja wissen welches select-Feld gerade übermittelt...

Javascript != Java => verschoben ins Webdesign Forum

Ich würde es allerdings in die "Skript- und Webserverprogrammierung" Verschieben, da Skriptprogrammierung.


stringIndex = document.getElementById(s).selectedIndex;

Hier findest du mehr Informationen zu DOM-Funktionen.

M.f.G.

Cad

hi,

elend ank für die hilfe. mit eurer hilfe hat es funktioniert.

danke!!

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.