peterS.: Gibt's gotfocus()? Ich kann keine richtige Frage finden...

Beitrag lesen

gruss Graphity,

dann eben so ?:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

<head>
<title>clickDenDoktorFormular.html</title>
</head>

<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<table cols="1" rows="1" width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
 <td align="right" valign="middle">

<form name="inputText">
 <table cols="1" rows="" height="" cellspacing="0" cellpadding="0" border="0">
 <tr>
  <td height="20" align="left" valign="top"><input type="text" name="diensthabenderArzt" value="" size="20" maxlength="30" onfocus="top.frames['clickDenDoktorButtons'].setButtonFocus()" /></td>
 </tr>
 </table>
 </form>

</td>
</tr>
</table>
</body>

</html>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

<head>
<title>clickDenDoktorButtons.html</title>
<script language="JavaScript" type="text/javascript">
<!--
// dha: DienstHabenderArzt
var dhaArray = [["Margit Schneider"],["Marko Schulze"],["Britta Mahlow"],["Boris Mueller"],["Susanne Buergel"],["Stefan Blaschke"],["Romy Pippig"],["Ronald Pfitzner"]];

function getTheDoctors() {
 myText = '<table cols="1" rows="' + dhaArray.length + '" height="" cellspacing="0" cellpadding="0" border="0">\n'
 for (var i=0;i<dhaArray.length;i++) {
  myText += '<tr>\n\t<td height="20" align="left" valign="top"><input type="button" value="' + dhaArray[i] + '" size="30" onclick="setInputTextValue(' + (i+1) + ')" /></td>\n</tr>\n';
 }
 myText += '</table>\n';
 return myText;
}

function setInputTextValue(dhaIndex) {
 top.frames["clickDenDoktorFormular"].document.forms["inputText"].elements["diensthabenderArzt"].value = dhaArray[(dhaIndex-1)];
 if (dhaIndex >= dhaArray.length) {
  top.focus();
 } else {
  document.forms["inputButton"].elements[dhaIndex].focus();
 }
}
function setButtonFocus() {
 var myField = top.frames["clickDenDoktorFormular"].document.forms["inputText"].elements["diensthabenderArzt"];
 var proofExistence = false;
/* if (myField.value == "") {
  document.forms["inputButton"].elements[0].focus();
  return;
 }*/
 for (var i=0;i<dhaArray.length;i++) {
  if (myField.value == dhaArray[i]) {
   document.forms["inputButton"].elements[i].focus();
   proofExistence = true;
   break;
  }
 }
 if (!proofExistence) {
  document.forms["inputButton"].elements[0].focus();
 }
}
//-->
</script>
</head>

<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<table cols="1" rows="1" width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
 <td align="left" valign="middle">

<form name="inputButton">
<script language="JavaScript" type="text/javascript">document.write(getTheDoctors());</script>
<!--
 <table cols="1" rows="" height="" cellspacing="0" cellpadding="0" border="0">
 <tr>
  <td height="20" align="left" valign="top"><input type="button" value="Margit Schneider" size="30" onclick="setInputTextValue(1)" /></td>
 </tr>
 <tr>
  <td height="20" align="left" valign="top"><input type="button" value="Marko Schulze" size="30" onclick="setInputTextValue(2)" /></td>
 </tr>
 <tr>
  <td height="20" align="left" valign="top"><input type="button" value="Britta Mahlow" size="30" onclick="setInputTextValue(3)" /></td>
 </tr>
 <tr>
  <td height="20" align="left" valign="top"><input type="button" value="Boris Mueller" size="30" onclick="setInputTextValue(4)" /></td>
 </tr>
 <tr>
  <td height="20" align="left" valign="top"><input type="button" value="Susanne Buergel" size="30" onclick="setInputTextValue(5)" /></td>
 </tr>
 <tr>
  <td height="20" align="left" valign="top"><input type="button" value="Stefan Blaschke" size="30" onclick="setInputTextValue(6)" /></td>
 </tr>
 <tr>
  <td height="20" align="left" valign="top"><input type="button" value="Romy Pippig" size="30" onclick="setInputTextValue(7)" /></td>
 </tr>
 <tr>
  <td height="20" align="left" valign="top"><input type="button" value="Ronald Pfitzner" size="30" onclick="setInputTextValue(8)" /></td>
 </tr>
 </table>
//-->
 </form>

</td>
</tr>
</table>
</body>

</html>

by(t)e by(t)e - peterS. - pseliger@gmx.net