HighDots Forums  

Fehlerhafte Interpretation bei onBlur() und focus()

Javascript (German) Programmiersprache JavaScript. (de.comp.lang.javascript)


Discuss Fehlerhafte Interpretation bei onBlur() und focus() in the Javascript (German) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
codenex@googlemail.com
 
Posts: n/a

Default Fehlerhafte Interpretation bei onBlur() und focus() - 08-10-2006 , 08:32 PM






Guten Morgen,

ich sitze jetzt schon seit einiger Zeit an einem Script, welches
scheinbar ein Eigenleben zu entwickeln scheint.

Ich habe eine Formular, welches sich in einer Tabelle befindet.
Innerhalb der Tabelle habe ich Inputfelder in 3 Spalten platziert. Beim
Verlassen des ersten Feldes würde der Cursor regulär automatisch ein
Feld nach rechts springen. Ich möchte allerdings, dass der Cursor ein
Feld nach unten springt.

Anbei ein Auszug meines Scriptes:
<?php

echo"
<form method=\"get\" action=\"". $PHP_SELF."\">
<table cellpadding=\"0\" cellspacing=\"2\" border=\"0\"
align=\"center\">
<tr>
<th colspan=\"7\" id=\"right\"><a
href=\"javascript:window.close()\"><img
src=\"images/schliessen-big.gif\"
alt=\"schliessen\" width=\"100\" height=\"18\"
border=\"0\"></a></th></tr>
<tr>
<th colspan=\"7\"><strong><big>&raquo; Hier kannst du den Datensatz
eines Kunden bearbeiten</big></strong></th></tr>
<tr>
<th width=\"70\">Kd.Nr.:</th>
<td width=\"160\" colspan=\"2\" class=\"input4\"> &nbsp;" .
$daten['id'] . "</td>
<th>Tel.:</th>
<td width=\"160\"><input type=\"Text\" name=\"tel\" value=\"" .
$daten['tel'] . "\" class=\"input4\"
onfocus=\"this.style.backgroundColor='#E7D796';\"
onblur=\"this.form.fax.focus(); this.style.backgroundColor=''; return
false;\"></td>
<th>Ansprechpartner:</th>
<td width=\"160\"><input type=\"Text\" name=\"ansprechpartner\"
value=\"" . $daten['ansprechpartner'] . "\" class=\"input4\"
onfocus=\"this.style.backgroundColor='#E7D796';\"
onblur=\"this.form.durchwahl.focus(); this.style.backgroundColor='';
return false;\"></td></tr>
<tr>
<th>Firma:</th>
<td colspan=\"2\"><input type=\"Text\" name=\"firma\" value=\"" .
$daten['firma'] . "\" class=\"input4\"
onfocus=\"this.style.backgroundColor='#E7D796';\"
onblur=\"this.form.strasse.focus(); this.style.backgroundColor='';
return false;\"></td>
<th>Fax:</th>
<td><input type=\"Text\"name=\"fax\" value=\"" . $daten['fax'] . "\"
class=\"input4\"
onfocus=\"this.style.backgroundColor='#E7D796';\"
onblur=\"this.form.email.focus(); this.style.backgroundColor=''; return
false;\"></td>
<th>Durchwahl:</th>
<td><input type=\"Text\" name=\"durchwahl\" value=\"" .
$daten['durchwahl'] . "\" class=\"input4\"
onfocus=\"this.style.backgroundColor='#E7D796';\"
onblur=\"this.form.kommentar.focus(); this.style.backgroundColor='';
return false;\"></td></tr>
<tr>
<th>Strasse:</th>
<td colspan=\"2\"><input type=\"Text\" name=\"strasse\" value=\"" .
$daten['strasse'] . "\" class=\"input4\"
onfocus=\"this.style.backgroundColor='#E7D796';\"
onblur=\"this.form.plz.focus(); this.style.backgroundColor=''; return
false;\"></td>
<th>Email:</th>
<td><input type=\"Text\" name=\"email\" value=\"" . $daten['email']
.. "\" class=\"input4\"
onfocus=\"this.style.backgroundColor='#E7D796';\"
onblur=\"this.form.web.focus(); this.style.backgroundColor=''; return
false;\"></td>
<th colspan=\"2\">&nbsp;</th></tr>
<tr>
<th>PLZ/Ort:</th>
<td><input type=\"Text\" name=\"plz\" value=\"" . $daten['plz'] .
"\" class=\"input5\" maxlength=\"5\"
onfocus=\"this.style.backgroundColor='#E7D796';\"
onblur=\"this.form.ort.focus(); this.style.backgroundColor=''; return
false;\"></td>
<td><input type=\"Text\" name=\"ort\" value=\"" . $daten['ort'] .
"\" class=\"input6\"
onfocus=\"this.style.backgroundColor='#E7D796';\"
onblur=\"this.form.tel.focus(); this.style.backgroundColor=''; return
false;\";></td>
<th>Web:</th>
<td><input type=\"Text\" name=\"web\" value=\"" . $daten['web'] .
"\" class=\"input4\"
onfocus=\"this.style.backgroundColor='#E7D796';\" onblur=\"
this.form.ansprechpartner.focus(); this.style.backgroundColor='';
return false;\"></td>
<th colspan=\"2\">&nbsp;</th></tr>
<tr>
<th colspan=\"7\">Kommentar:</th></tr>
<tr>
<td colspan=\"7\"><textarea name=\"kommentar\" rows=\"10\"
cols=\"10\" class=\"input7\"
onfocus=\"this.style.backgroundColor='#E7D796';\"
onblur=\"this.style.backgroundColor=''; this.form.submit.focus();
return false;\">" . $daten['kommentar'] . "</textarea></td></tr>
<tr>
<th colspan=\"7\"><input type=\"Submit\" name=\"submit\"
value=\"speichern\" class=\"input8\">
<input type=\"reset\" value=\"nicht speichern\" class=\"input8\"
onclick=window.close()></th></tr>
</table>
<input type=\"Hidden\" name=\"id\" value=\"" . $daten['id'] . "\">
<input type=\"Hidden\" name=\"action\" value=\"aendern\">
</form>";
?>


Wie zu erkennen ist, befindet sich das Script innerhalb einer PHP
Anweisung. Das Problem hat allerdings mit PHP ncihts zu tun. Die
Ausgaben funktionieren einwandtfrei.

Komischerweise Funktioniert das Script im Firefox im einwandtfrei. Nur
der InternetExplorer bekommt eine korrekte Ausgabe einfach nicht hin.

Über Lösungsvorschläge wär ich sehr dankbar!

Gruss Ni!z


Reply With Quote
  #2  
Old   
Frank Schenk
 
Posts: n/a

Default Re: Fehlerhafte Interpretation bei onBlur() und focus() - 08-11-2006 , 03:49 AM






codenex (AT) googlemail (DOT) com wrote:
Quote:
Guten Morgen,

ich sitze jetzt schon seit einiger Zeit an einem Script, welches
scheinbar ein Eigenleben zu entwickeln scheint.

Ich habe eine Formular, welches sich in einer Tabelle befindet.
Innerhalb der Tabelle habe ich Inputfelder in 3 Spalten platziert. Beim
Verlassen des ersten Feldes würde der Cursor regulär automatisch ein
Feld nach rechts springen. Ich möchte allerdings, dass der Cursor ein
Feld nach unten springt.
Für sowas gibts tabindex (HTML Attribut)

Siehe: http://de.selfhtml.org/html/formular...tabreihenfolge


Frank


Reply With Quote
  #3  
Old   
Niels Lange
 
Posts: n/a

Default Re: Fehlerhafte Interpretation bei onBlur() und focus() - 08-11-2006 , 11:29 AM



hi frank,

vielen dank für die schnelle antwort. mit tabindex verhält sich das
formular genau so, wie es soll. sauber!

gruss ni!z


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.