Annette: Verschachtelter Skriptblock

Beitrag lesen

auwei, ihr habt's so gewollt... ihr armen... (bei ASP nehme ich JScript)

"..."

<%   }   /*       AKTION = 1 (KOPF WURDE VERSENDET) - ANFANG -

Hier werden zeilenweise die Teilenummern eingegeben   */   if (aktion == "1") {

teil  = new Array(15);     bez   = new Array(15);     menge = new Array(15);     eilkz = new Array(15);     referenz = new Array(15);

z_index = Request.Form("z_index");     z_show  = Request.Form("z_show");

for (i=1; i++; i<=15) {

n = i-1;       teil[n] = "";       bez[n]  = "";       menge[n] = "";       eilkz[n] = "";       referenz[n] = "";

if (Request.Form("teile_nr_"+i).Count > 0) {         teil[n] = Request.Form("teile_nr_"+i);       }       if (Request.Form("menge_" + i).Count > 0) {         menge[n] = Request.Form("menge_"+i);       }       if (Request.Form("eilkz_" + i).Count > 0) {         eilkz[n] = Request.Form("eilkz_"+i);       }       if (Request.Form("referenz_" + i).Count > 0) {         referenz[n] = Request.Form("referenz_"+i);       }

}

/***** Bezeichnung holen *****/         try {             connect = Server.CreateObject("ADODB.Connection");             connect.Open("Bremer Modell","sa","")             recset = Server.CreateObject("ADODB.RecordSet");

for (n=0; n++; n<15) {

if (teil[n] !="") {                  sql = "SELECT * FROM Lagerjournal.dbo.ETDIEBP WHERE ETNR='"+teil[n]+"'";                  recset.open(sql,connect,adOpenKeyset,adLockReadOnly);                  if (recset.BOF || recset.EOF) {                     bez[n] = "ungültige Teilenr.";                  }                  else {                     bez[n] = recset("ETBEZ").value;                  }               }             }             connect.close;         }         catch(e) {             msg = e.description;             Response.Write(msg);         } %>

<!--form action="re_auftrag.asp" method="post" name="sender">

<script language="JavaScript">   <!--      for (i=1; i<=15; i++) {         document.write('  <input type="hidden" name="teile_nr_' + i + '">\n');         document.write('  <input type="hidden" name="menge_' + i + '">\n');         document.write('  <input type="hidden" name="eil_kz_'+ i + '">\n');         document.write('  <input type="hidden" name="referenz_' + i + '">\n');         document.write('  <input type="hidden" name="position_' + i + '">\n');         document.write('  <input type="hidden" name="bestellen_' + i + '">\n');      }

//-->   <!--/script>   <input type="hidden" name="k_referenz">   <input type="hidden" name="k_auftrag">

</form-->

<form name="kopf"> <table border="0" width="735" bgcolor="#FFFFFF" cellspacing="2" cellpadding="2">     <tr bgcolor="#C0C0C0">             <td width="105" bgcolor="#FFFFFF" height="23"><img src="images/transparent.gif" width="105" height="8"></td>             <td width="160"><font face="Arial, Helvetica, sans-serif" size="2">Kunde</font></td>             <td width="160"><font face="Arial, Helvetica, sans-serif" size="2">Fabrikat</font></td>             <td width="145"><font face="Arial, Helvetica, sans-serif" size="2">Referenz</font></td>             <td width="140"><font face="Arial, Helvetica, sans-serif" size="2">Auftragsart</font></td>             <td width="100"><font face="Arial, Helvetica, sans-serif" size="2">Auftragsnummer</font></td>     </tr>     <tr bgcolor="#E2E2E2">             <td width="105" bgcolor="#FFFFFF" height="23"><img src="images/transparent.gif" width="105" height="8"></td>             <td width="160"><font face="Arial, Helvetica, sans-serif" size="2"><b><% Response.Write(user); %></b></font></td>             <td width="160"><font face="Arial, Helvetica, sans-serif" size="2"><b>C</b></font></td>             <td width="145"><font face="Arial, Helvetica, sans-serif" size="2"><b><% Response.Write(ref); %></b></font></td>             <td width="140"><font face="Arial, Helvetica, sans-serif" size="2"><b><% Response.Write(art); %></b></font></td>             <td width="100"><font face="Arial, Helvetica, sans-serif" size="2"><b><% Response.Write(aktuell); %> </b></font></td>     </tr> </table> <input type="hidden" name="lpos" value="<% Response.Write(lpos); %>"> <input type="hidden" name="z_index" value="<% Response.Write(z_index) %>"> <input type="hidden" name="z_index" value="<% Response.Write(z_show) %>"> <input type="hidden" name="k_referenz" value="<% Response.Write(ref); %>"> <input type="hidden" name="k_auftrag" value="<% Response.Write(art); %>"> <input type="hidden" name="aktuell" value="<% Response.Write(aktuell); %>"> <%   for(i=1; i++; i<=z_index) {     n = i-1;     Response.Write('<input type="hidden" name="teile_nr_'+i+'" value="'+teil[n]+'">\n');     Response.Write('<input type="hidden" name="bez_'+i+'" value="'+bez[n]+'">\n');     Response.Write('<input type="hidden" name="menge_'+i+'" value="'+menge[n]+'">\n');     Response.Write('<input type="hidden" name="eilkz_'+i+'" value="'+eilkz[n]+'">\n');     Response.Write('<input type="hidden" name="referenz_'+i+'" value="'+referenz[n]+'">\n');   } %>

</form> </div>

<script language="Javascript"> <!--   /* Tabellenkopf */

document.write('<div id="ebene0">\n');   document.write('<table border="0" width="929" cellspacing="2" cellpadding="2">\n');   document.write('  <tr bgcolor="#FFFFFF">\n');   document.write('    <td width="105"><img src="images/transparent.gif" width="105" height="15"></td>\n');

document.write('    <td width="108" bgcolor="#CCCCCC" height="29"><font face="Arial, Helvetica, sans-serif" size="2">Position</font></td>\n');   document.write('    <td width="101" bgcolor="#CCCCCC" height="29"><font face="Arial, Helvetica, sans-serif" size="2">Teile-Nr.</font></td>\n');   document.write('    <td width="230" bgcolor="#CCCCCC" height="29"><font face="Arial, Helvetica, sans-serif" size="2">Bezeichnung</font></td>\n');   document.write('    <td width="53"  bgcolor="#CCCCCC" height="29"><font face="Arial, Helvetica, sans-serif" size="2">Menge</font></td>\n');   document.write('    <td width="77"  bgcolor="#CCCCCC" height="29"><font face="Arial, Helvetica, sans-serif" size="2">Eil-Kz.</font></td>\n');   document.write('    <td width="255" bgcolor="#CCCCCC" height="29"><font face="Arial, Helvetica, sans-serif" size="2">Referenz</font></td>\n');

document.write("  </tr>\n");   document.write("</table>\n");   document.write("</div>\n");

document.write('<div id="ebene01">\n');   document.write('<form name="BESTELL">\n')

teil  = new Array(15);   bez   = new Array(15);   menge = new Array(15);   eilkz = new Array(15);   referenz = new Array(15);

for (n=0; n++; n<15) {

x = 6+(5*n);

teil[n]     = document.kopf.elements[x]; x = x+1;     bez[n]      = document.kopf.elements[x]; x = x+1;     menge[n]    = document.kopf.elements[x]; x = x+1;     eilkz[n]    = document.kopf.elements[x]; x = x+1;     referenz[n] = document.kopf.elements[x];   }

/* Eingabezeilen */   for(i=1; i++; i<=z_index) {

n  = i-1;     ii = i;     if (i<10) ii = "0" + i;

if ((i1+lpos1)<10) {       pos = "00" + (i1+lpos1);     }     else {       pos = "0" + (i1+lpos1);     }     next = i+1;

document.write('<table border="1" width="929" cellspacing="2" cellpadding="2">\n');     document.write('  <tr bgcolor="#FFFFFF">\n');

document.write('    <td width="105"><img src="images/transparent.gif" width="105" height="15"></td>\n');     document.write('    <td width="88" height="24"><font face="Arial, Helvetica, sans-serif" size="2"><b>' + pos + '</b></font></td>\n');     document.write('    <td width="81" height="24"><input type="text" name="teile_nr_' + i + '" size="25" onBlur="chkTeileNr(this)"></td>\n');     document.write('    <td width="270"><font face="Arial" size="2"><b>'+bez[n]+'</b></font><input type="hidden" name="bez_'+i+'" value="'+bez[n]+'"></td>');     document.write('<input type="hidden" name="position_' + i + '" value="' + pos + '">');     document.write('<input type="hidden" name="bestellen_'+i+'" value="Y">\n');

/* zuletzt eingegebene Zeile: Teilenummer ungültig*/     if (i == z_index && z_show == "b" && bez[n] == "ungültige Teilenr." ) {        z_show = "a";     }

if ((i < z_index) || (i == z_index && z_show == "b")) {        document.write('    <td width="53" height="24"><input type="text" name="menge_' + i + '" value="'+menge[n]+'" size="6" maxlength="4" onKeyPress="checkKey()" onBlur="chkMenge(this)"></td>\n');        document.write('    <td width="77" height="24"><input type="text" name="eilkz_' + i + '" value="'+eilkz[n]+'" size="3" onKeyPress="checkKey()"></td>\n');        document.write('    <td width="255" height="24"><input type="text" name="referenz_' + i + '" value="'+referenz[n]+'" size="3" onKeyPress="checkKey()" onBlur="chkReferenz(this, i)"></td>\n');     }     if (i == z_index && z_show == "a") {        document.write('    <td width="53" height="24"> </td>\n');        document.write('    <td width="77" height="24"> </td>\n');        document.write('    <td width="255" height="24"> </td>\n');     }     document.write("    </td>\n");     document.write("  </tr>\n");     document.write("</table>\n");

}   document.write("</form>\n");   document.write("</div>\n"); //--> </script>

<div id="ebene999">

<a href="javascript:absenden()"><img src="images/bt_bestellen.gif" border="0" WIDTH="97" HEIGHT="19"></a> <a href="et_auftrag.asp"><img src="images/bt_cancel.gif" border="0" WIDTH="126" HEIGHT="19"></a>

</div> <%   } %> ...