Christian: Radio-Button in Abhängigkeit von zwei Textfeldern setzen

Beitrag lesen

Hi Leutz,

ich bin leider kein JavaScript-Guru wie so viele hier. Daher eine kleine Frage, wie man folgendes Problem lösen kann:

Ich habe auf einer HTML-Seite eine Formular das unter anderem folgende Felder enthält:

<form name="layout" method="post" onSubmit="return submitForm();" onDblClick="hideLayoutForm()"action="/sap/bw/BEx?SAP-LANGUAGE=D&PAGENO=1&CMD=PROCESS_HELP_WINDOW&DATA_PROVIDER=DATAPROVIDER_1&HELP_SERVICE=ZPRINTING&ITEM=TABLE_1&REQUEST_NO=1"            style="page-break-after:always; display:inline; FONT-STYLE:normal; FONT-FAMILY: arial, sans-serif; FONT-WEIGHT: normal; FONT-SIZE:x-small;">
[...]
<input type=radio name="seite" value="A4H" onClick="papierformat('A4H');"> A4 Hochformat
<input type=radio name="seite" value="A4Q" onClick="papierformat('A4Q');"> A4 Querformat
<input type=radio name="seite" value="A3H" onClick="papierformat('A3H');"> A3 Hochformat
<input type=radio name="seite" value="A3Q" onClick="papierformat('A3Q');"> A3 Querformat
<input type=text name=p_page_width size=10  value="28.00">
<input type=text name=p_page_height size=10  value="37.00">
<input type=text name=anzeige1><br>
<input type=text name=anzeige2><br>
<input type=text name=anzeige3><br>

in Abhängigkeit der Werte aus den beiden Feldern p_page_width und p_page_height soll dann einer der Radio-Buttons als checked markiert werden.
Hierzu rufe ich beim Body-Tag mit Hilfe des onLoad folgende Funktion auf:

function papierformat2()
{
  document.layout.anzeige1.value = document.layout.p_page_height.value;
  document.layout.anzeige2.value = document.layout.p_page_width.value;
  if (document.layout.p_page_height.value == '28.00') and
     (document.layout.p_page_width.value  == '18.50')
       {
       document.layout.anzeige3.value = 0;
       document.layout.seite[0].checked = true;
       }
  if (document.layout.p_page_height.value == '18.50') and
     (document.layout.p_page_width.value  == '28.00')
       {
       document.layout.anzeige3.value = 1;
       document.layout.seite[1].checked = true;
       }
  if (document.layout.p_page_height.value == '37.00') and
     (document.layout.p_page_width.value  == '28.00')
       {
       document.layout.anzeige3.value = 2;
       document.layout.seite[2].checked = true;
       }
  if (document.layout.p_page_height.value == '28.00') and
     (document.layout.p_page_width.value  == '37.00')
       {
       document.layout.anzeige3.value = 3;
       document.layout.seite[3].checked = true;
       }
 }

Nur leider klappt das ganze nicht ;-((
Vielleicht stehe ich ja nur aufm Schlauch und sehe vor lauter Bäumen den Wald nicht aber dennoch :

HILFE !!!!

Thanx
Christian