Hi,
ich möchte mittels Javascript Feldinhalte tauschen.
Habe dafür folgendes gebastelt:
HTML-Code:
<script type="text/javascript">
function tausch(a,b) {
var da = document.tauschformular.xxx.value;
var db = document.tauschformular.yyy.value;
document.tauschformular.xxx.value=db;
document.tauschformular.yyy.value=da;
}
</script>
Als Formular:
HTML-Code:
<form method=post name=tauschformular>
<input type="text" value="Inhalt xxx" name="xxx" onclick="tausch('xxx','yyy');" />
<input type="text" value="Inhalt yyy" name="yyy">
</form>
Wie kann ich jetzt im Formular aus "a" und "b" die entsprechenden Formularnamen (xxx, yyy) übernehmen, also die mit Aufruf
tausch('xxx','yyy'); übergebenen values tauschen?
Kann mir da jemand mal 'ne gezielte Hilfestellung geben?
Ciao, Giz