Avatar billede avminarm Juniormester
17. september 2003 - 15:08 Der er 7 kommentarer og
2 løsninger

lægge sammen i formular - realtime

jeg har denne model af en formular jeg skal benytte til opdatering af en statistik - se evt. http://www.eksperten.dk/spm/402068 (og nej det er ikke samme sprg ;o]) for info.

Formularmodel: http://wagners.users.whitehat.dk/eksperten/opdater_model.htm

Jeg tænkte på om jeg kunne få felterne til at opdatere sig (dem som er disabled) når man indtaster noget i input - skal dette lægges sammen med det tal der står i [x], som hentes i en database.

der er ikke tale om et fast antal personer der figurerer, dette tal kan variere.

NB: jeg er meget skidt til javascript - jeg har søgt her på exp.dk, men kan simpelthem ikke få det jeg finder til at virke. Derfor i meget gerne give nogle gode forklaringer løbende og meget gerne benytte mit eget eksempel.

Jeg håber det er forklaret godt nok ;o)
Avatar billede medions Nybegynder
17. september 2003 - 15:11 #1
Jeg har liiiiiiiiiiiiiiiige lavet denne, så den er helt frisk ;o)


<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/strict.dtd">
<html>
  <head>
    <title>
      Purchase order
    </title>
<style type="text/css">
    td {
        font-family: verdana;
        font-size: 10px;
    }
   
    input {
        border: 0px;
    }
  textarea {scrollbar-3dlight-color:white;
          scrollbar-arrow-color:white;
          scrollbar-base-color:white;
          scrollbar-darkshadow-color:white;
          scrollbar-face-color:white;
          scrollbar-highlight-color:white;
          scrollbar-shadow-color:white}
  </STYLE>
</style>



<script language="JavaScript">
        function FindTotal(id) {
            document.frm1.Total.value = parseInt(document.frm1.result0.value + document.frm1.result1.value + document.frm1.result2.value + document.frm1.result3.value + document.frm1.result4.value + document.frm1.result5.value + document.frm1.result6.value + document.frm1.result7.value + document.frm1.result8.value + document.frm1.result9.value + document.frm1.result10.value);
        }
</script>

  </head>
  <body style="margin: 0, 0, 0, 0;">
    <!-- //Top -->
    <table cellpadding="0" cellspacing="0" border="0">
      <tr>
        <td valign="top" style="width: 560px;">
          <span style="font-family: verdana; font-size: 16px; font-weight: bold;">Purchase order</span>
        </td>
        <td align="right">
          <img src="img/netlogo_anim.gif" />
        </td>
      </tr>
    </table>
    <!-- //Supplier and adv. information -->
    <table>
      <tr>
        <td style="width: 450px;" valign="top">
          <table cellpadding="0" cellspacing="0">
            <tr>
              <td>
                Supplier:
              </td>
            </tr>
            <tr>
              <td>
                <textarea name="supplier" rows="5" cols="30" style="font-family: verdana;font-size: 10px; border: #000000 1px solid;" scrollbar="0"></textarea>
              </td>
            </tr>
            <tr>
              <td>
                <br />
               
                <table cellspacing="0" cellpadding="0">
                  <tr>
                    <td>
                      Tel.:
                    </td>
                    <td>
                      <input type="text" name="Tel" style="border-bottom: #000000 1px solid; width: 60px;">
                    </td>
                  </tr>
                  <tr>
                    <td>
                      Fax.:
                    </td>
                    <td>
                      <input type="text" name="Fax" style="border-bottom: #000000 1px solid; width: 60px;">
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
        </td>
        <td valign="top">
          <table cellpadding="0" cellspacing="0">
            <tr>
              <td align="right" style="width: 200px;">
                Headoffice:<br />
                Kokmose 5<br />
                DK-6000 Kolding<br />
                Denmark<br />
                Tel.: +45 79 38 47 00<br />
                Fax.: +45 79 38 47 80<br />
              </td>
            </tr>
            <tr>
              <td>
                <table cellpadding="0" cellspacing="0">
                  <tr>
                    <td valign="top" style="border-top: #000000 1px solid;">
                      Order no.:
                    </td>
                    <td style="border-top: #000000 1px solid; text-align: right; width: 142px;font-size: 17px; font-weight: bold; color: #ff0000;">
                      1
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
            <tr>
              <td>
                <table cellpadding="0" cellspacing="0">
                  <tr>
                    <td valign="top" style="border-top: #000000 1px solid;">
                      Capex no.:
                    </td>
                    <td style="border-top: #000000 1px solid;">
                      <input type="text" name="Orderno" style="text-align: right; width: 137px;" />
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
            <tr>
              <td>
                <table cellpadding="0" cellspacing="0">
                  <tr>
                    <td valign="top" style="border-top: #000000 1px solid;">
                      Account no.:
                    </td>
                    <td style="border-top: #000000 1px solid;">
                      <input type="text" name="Orderno" style="text-align: right; width: 131px;" />
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    <!-- //We hereby order --><span style="font-weight: bold; font-family: verdana; font-size: 10px;">We hereby order:</span>
<form action="Purhaseorder.asp?Save=Order" name="frm1" method="post">
    <table style="width: 649px; border: #000000 1px solid;" cellpadding="0" cellspacing="0">
      <tr>
        <td style="width: 170px; border-bottom: #000000 1px solid;">
          &nbsp;Description
        </td>
        <td style="width: 120px; border-left: #000000 1px solid; border-bottom: #000000 1px solid;">
          &nbsp;Date of delivery
        </td>
        <td style="width: 160px; border-left: #000000 1px solid; border-bottom: #000000 1px solid;">
          &nbsp;Quanity
        </td>
        <td style="width: 90px; border-left: #000000 1px solid;">
          <table cellpadding="0" cellspacing="0" style="width: 190px;">
            <tr>
              <td align="center" style="border-bottom: #000000 1px solid;">Excl. VAT</td>
            </tr>
            <tr>
              <td>
                <table cellpadding="0" cellspacing="0">
                  <tr>
                    <td style="width: 105px; border-bottom: #000000 1px solid;" align="center">Price</td>
                    <td style="width: 110px; border-left: #000000 1px solid; border-bottom: #000000 1px solid;" align="center">Total</td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
   
    <table style="width: 649px; border: #000000 1px solid;" cellpadding="0" cellspacing="0">

      <tr>
            <td style="border-right: #000000 1px solid; width: 170px; border-bottom: #000000 1px solid; border-left: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 164px;"><td>
          <td style="border-right: #000000 1px solid; width: 121px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 110px;"></td>
          <td style="border-right: #000000 1px solid; width: 161px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="quanity0" id="quanity0" style="font-size: 9px; width: 155px;"></td>
          <td style="border-right: #000000 1px solid;">
                <table cellpadding="0" cellspacing="0">
                      <tr>
                        <td style="width: 92px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="price0" id="price0" onblur="document.frm1.result0.value = parseInt(this.value) * parseInt(document.frm1.quanity0.value);" style="font-size: 9px; width: 85px; text-align: right;"></td>
                        <td style="border-left: #000000 1px solid; height: 17px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="result0" onblur="FindTotal(0);" style="font-size: 9px; width: 90px; text-align: right;" readonly></td>
                    </tr>
              </table>
          </td>
      </tr>

      <tr>
            <td style="border-right: #000000 1px solid; width: 170px; border-bottom: #000000 1px solid; border-left: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 164px;"><td>
          <td style="border-right: #000000 1px solid; width: 121px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 110px;"></td>
          <td style="border-right: #000000 1px solid; width: 161px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="quanity1" id="quanity1" style="font-size: 9px; width: 155px;"></td>
          <td style="border-right: #000000 1px solid;">
                <table cellpadding="0" cellspacing="0">
                      <tr>
                        <td style="width: 92px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="price1" id="price1" onblur="document.frm1.result1.value = parseInt(this.value) * parseInt(document.frm1.quanity1.value);" style="font-size: 9px; width: 85px; text-align: right;"></td>
                        <td style="border-left: #000000 1px solid; height: 17px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="result1" onblur="FindTotal(1);" style="font-size: 9px; width: 90px; text-align: right;" readonly></td>
                    </tr>
              </table>
          </td>
      </tr>

      <tr>
            <td style="border-right: #000000 1px solid; width: 170px; border-bottom: #000000 1px solid; border-left: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 164px;"><td>
          <td style="border-right: #000000 1px solid; width: 121px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 110px;"></td>
          <td style="border-right: #000000 1px solid; width: 161px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="quanity2" id="quanity2" style="font-size: 9px; width: 155px;"></td>
          <td style="border-right: #000000 1px solid;">
                <table cellpadding="0" cellspacing="0">
                      <tr>
                        <td style="width: 92px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="price2" id="price2" onblur="document.frm1.result2.value = parseInt(this.value) * parseInt(document.frm1.quanity2.value);" style="font-size: 9px; width: 85px; text-align: right;"></td>
                        <td style="border-left: #000000 1px solid; height: 17px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="result2" onblur="FindTotal(2);" style="font-size: 9px; width: 90px; text-align: right;" readonly></td>
                    </tr>
              </table>
          </td>
      </tr>

      <tr>
            <td style="border-right: #000000 1px solid; width: 170px; border-bottom: #000000 1px solid; border-left: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 164px;"><td>
          <td style="border-right: #000000 1px solid; width: 121px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 110px;"></td>
          <td style="border-right: #000000 1px solid; width: 161px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="quanity3" id="quanity3" style="font-size: 9px; width: 155px;"></td>
          <td style="border-right: #000000 1px solid;">
                <table cellpadding="0" cellspacing="0">
                      <tr>
                        <td style="width: 92px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="price3" id="price3" onblur="document.frm1.result3.value = parseInt(this.value) * parseInt(document.frm1.quanity3.value);" style="font-size: 9px; width: 85px; text-align: right;"></td>
                        <td style="border-left: #000000 1px solid; height: 17px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="result3" onblur="FindTotal(3);" style="font-size: 9px; width: 90px; text-align: right;" readonly></td>
                    </tr>
              </table>
          </td>
      </tr>

      <tr>
            <td style="border-right: #000000 1px solid; width: 170px; border-bottom: #000000 1px solid; border-left: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 164px;"><td>
          <td style="border-right: #000000 1px solid; width: 121px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 110px;"></td>
          <td style="border-right: #000000 1px solid; width: 161px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="quanity4" id="quanity4" style="font-size: 9px; width: 155px;"></td>
          <td style="border-right: #000000 1px solid;">
                <table cellpadding="0" cellspacing="0">
                      <tr>
                        <td style="width: 92px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="price4" id="price4" onblur="document.frm1.result4.value = parseInt(this.value) * parseInt(document.frm1.quanity4.value);" style="font-size: 9px; width: 85px; text-align: right;"></td>
                        <td style="border-left: #000000 1px solid; height: 17px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="result4" onblur="FindTotal(4);" style="font-size: 9px; width: 90px; text-align: right;" readonly></td>
                    </tr>
              </table>
          </td>
      </tr>

      <tr>
            <td style="border-right: #000000 1px solid; width: 170px; border-bottom: #000000 1px solid; border-left: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 164px;"><td>
          <td style="border-right: #000000 1px solid; width: 121px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 110px;"></td>
          <td style="border-right: #000000 1px solid; width: 161px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="quanity5" id="quanity5" style="font-size: 9px; width: 155px;"></td>
          <td style="border-right: #000000 1px solid;">
                <table cellpadding="0" cellspacing="0">
                      <tr>
                        <td style="width: 92px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="price5" id="price5" onblur="document.frm1.result5.value = parseInt(this.value) * parseInt(document.frm1.quanity5.value);" style="font-size: 9px; width: 85px; text-align: right;"></td>
                        <td style="border-left: #000000 1px solid; height: 17px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="result5" onblur="FindTotal(5);" style="font-size: 9px; width: 90px; text-align: right;" readonly></td>
                    </tr>
              </table>
          </td>
      </tr>

      <tr>
            <td style="border-right: #000000 1px solid; width: 170px; border-bottom: #000000 1px solid; border-left: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 164px;"><td>
          <td style="border-right: #000000 1px solid; width: 121px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 110px;"></td>
          <td style="border-right: #000000 1px solid; width: 161px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="quanity6" id="quanity6" style="font-size: 9px; width: 155px;"></td>
          <td style="border-right: #000000 1px solid;">
                <table cellpadding="0" cellspacing="0">
                      <tr>
                        <td style="width: 92px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="price6" id="price6" onblur="document.frm1.result6.value = parseInt(this.value) * parseInt(document.frm1.quanity6.value);" style="font-size: 9px; width: 85px; text-align: right;"></td>
                        <td style="border-left: #000000 1px solid; height: 17px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="result6" onblur="FindTotal(6);" style="font-size: 9px; width: 90px; text-align: right;" readonly></td>
                    </tr>
              </table>
          </td>
      </tr>

      <tr>
            <td style="border-right: #000000 1px solid; width: 170px; border-bottom: #000000 1px solid; border-left: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 164px;"><td>
          <td style="border-right: #000000 1px solid; width: 121px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 110px;"></td>
          <td style="border-right: #000000 1px solid; width: 161px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="quanity7" id="quanity7" style="font-size: 9px; width: 155px;"></td>
          <td style="border-right: #000000 1px solid;">
                <table cellpadding="0" cellspacing="0">
                      <tr>
                        <td style="width: 92px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="price7" id="price7" onblur="document.frm1.result7.value = parseInt(this.value) * parseInt(document.frm1.quanity7.value);" style="font-size: 9px; width: 85px; text-align: right;"></td>
                        <td style="border-left: #000000 1px solid; height: 17px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="result7" onblur="FindTotal(7);" style="font-size: 9px; width: 90px; text-align: right;" readonly></td>
                    </tr>
              </table>
          </td>
      </tr>

      <tr>
            <td style="border-right: #000000 1px solid; width: 170px; border-bottom: #000000 1px solid; border-left: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 164px;"><td>
          <td style="border-right: #000000 1px solid; width: 121px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 110px;"></td>
          <td style="border-right: #000000 1px solid; width: 161px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="quanity8" id="quanity8" style="font-size: 9px; width: 155px;"></td>
          <td style="border-right: #000000 1px solid;">
                <table cellpadding="0" cellspacing="0">
                      <tr>
                        <td style="width: 92px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="price8" id="price8" onblur="document.frm1.result8.value = parseInt(this.value) * parseInt(document.frm1.quanity8.value);" style="font-size: 9px; width: 85px; text-align: right;"></td>
                        <td style="border-left: #000000 1px solid; height: 17px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="result8" onblur="FindTotal(8);" style="font-size: 9px; width: 90px; text-align: right;" readonly></td>
                    </tr>
              </table>
          </td>
      </tr>

      <tr>
            <td style="border-right: #000000 1px solid; width: 170px; border-bottom: #000000 1px solid; border-left: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 164px;"><td>
          <td style="border-right: #000000 1px solid; width: 121px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 110px;"></td>
          <td style="border-right: #000000 1px solid; width: 161px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="quanity9" id="quanity9" style="font-size: 9px; width: 155px;"></td>
          <td style="border-right: #000000 1px solid;">
                <table cellpadding="0" cellspacing="0">
                      <tr>
                        <td style="width: 92px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="price9" id="price9" onblur="document.frm1.result9.value = parseInt(this.value) * parseInt(document.frm1.quanity9.value);" style="font-size: 9px; width: 85px; text-align: right;"></td>
                        <td style="border-left: #000000 1px solid; height: 17px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="result9" onblur="FindTotal(9);" style="font-size: 9px; width: 90px; text-align: right;" readonly></td>
                    </tr>
              </table>
          </td>
      </tr>

      <tr>
            <td style="border-right: #000000 1px solid; width: 170px; border-bottom: #000000 1px solid; border-left: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 164px;"><td>
          <td style="border-right: #000000 1px solid; width: 121px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="" style="font-size: 9px; width: 110px;"></td>
          <td style="border-right: #000000 1px solid; width: 161px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="quanity10" id="quanity10" style="font-size: 9px; width: 155px;"></td>
          <td style="border-right: #000000 1px solid;">
                <table cellpadding="0" cellspacing="0">
                      <tr>
                        <td style="width: 92px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="price10" id="price10" onblur="document.frm1.result10.value = parseInt(this.value) * parseInt(document.frm1.quanity10.value);" style="font-size: 9px; width: 85px; text-align: right;"></td>
                        <td style="border-left: #000000 1px solid; height: 17px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="result10" onblur="FindTotal(10);" style="font-size: 9px; width: 90px; text-align: right;" readonly></td>
                    </tr>
              </table>
          </td>
      </tr>

      <tr>
            <td style="border-right: #000000 1px solid; width: 170px; border-bottom: #000000 1px solid; border-left: #000000 1px solid;">&nbsp;Total:<td>
          <td style="border-right: #000000 1px solid; width: 120px; border-bottom: #000000 1px solid;">&nbsp;</td>
          <td style="border-right: #000000 1px solid; width: 160px; border-bottom: #000000 1px solid;">&nbsp;</td>
          <td style="border-right: #000000 1px solid;">
                <table cellpadding="0" cellspacing="0">
                      <tr>
                        <td style="width: 92px; border-bottom: #000000 1px solid;">&nbsp;</td>
                        <td style="border-left: #000000 1px solid; height: 17px; border-bottom: #000000 1px solid;">&nbsp;<input type="text" name="Total" style="font-size: 9px; width: 90px; text-align: right;"></td>
                    </tr>
              </table>
          </td>
      </tr>
    </table>
    </form>
   
    <!-- //Remarks -->
    <table>
      <tr>
        <td>
            <table cellpadding="0" cellspacing="0">
                  <tr>
                        <td style="width: 490px;">
                            <table cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td>Remarks:</td>
                                  </tr>
                                  <tr>
                                        <td><input type="text" name="Remarks" style="border-bottom: #000000 1px solid; width: 250px;"></td>
                                  </tr>
                                    <tr>
                                        <td>Adress of delivery:</td>
                                  </tr>
                                  <tr>
                                        <td><input type="text" name="AdressOfDelivery" style="border-bottom: #000000 1px solid; width: 250px;"></td>
                                  </tr>
                                    <tr>
                                        <td>Terms of delivery:</td>
                                  </tr>
                                  <tr>
                                        <td><input type="text" name="TermsOfDelivery" style="border-bottom: #000000 1px solid; width: 250px;"></td>
                                  </tr>
                                    <tr>
                                        <td>Ordered by:</td>
                                  </tr>
                                  <tr>
                                        <td><input type="text" name="OrderedBy" style="border-bottom: #000000 1px solid; width: 250px;"></td>
                                  </tr>
                                    <tr>
                                        <td>Conditions accepted:</td>
                                  </tr>
                                  <tr>
                                        <td><input type="text" name="ConditionsAccepted" style="border-bottom: #000000 1px solid; width: 250px;"></td>
                                  </tr>
                                    <tr>
                                        <td>Date:</td>
                                  </tr>
                                  <tr>
                                        <td><input type="text" name="Date" value="17-09-03" style="font-size: 10px;"></td>
                                  </tr>
                          </table>
                      </td>
                      <td valign="top">
                            <table cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td>Date of order:</td>
                                  </tr>
                                  <tr>
                                        <td><input type="text" name="DateOfOrder" style="border-bottom: #000000 1px solid; width:150px;"></td>
                                  </tr>
                                    <tr>
                                        <td>Order sanction:</td>
                                  </tr>
                                  <tr>
                                        <td><input type="text" name="OrderSanction" style="border-bottom: #000000 1px solid; width:150px;"></td>
                                  </tr>
                                    <tr>
                                        <td>Supplier:</td>
                                  </tr>
                                  <tr>
                                        <td><input type="text" name="Supplier" style="border-bottom: #000000 1px solid; width:150px;"></td>
                                  </tr>
                          </table>
                      </td>
                  </tr>
            </table>
        </td>
      </tr>
    </table>
   
    <!-- //Buttons -->
    <p />
    <table style="width: 650px;">
          <tr>
                <td align="center"><input style="border: 1px solid;" type="button" name="" onclick="window.print();" value="Save">&nbsp;<input style="border: 1px solid;" type="button" name="" onclick="window.print();" value="Open"></td>
          </tr>
    </table>

  </body>
</html>


Se om du kan få inspiration fra den ;o)
//>Rune
Avatar billede avminarm Juniormester
17. september 2003 - 15:22 #2
Det duer ikke rigtigt - den skriver bare NaN! og den du har lavet tager ikke højde for der er variabelt hvor mange spillere der skal opdateres - og jeg er altså MINIskarp til javascript syntaxen ;o(
Avatar billede medions Nybegynder
17. september 2003 - 15:24 #3
Altså:

Quanity skal være et tal
og Price skal være et tal, så skriver den ikke NaN! ;o)

-og brug Tab tasten til at navigere dig rundt i tabellen!


//>Rune
Avatar billede avminarm Juniormester
17. september 2003 - 15:27 #4
ok sorry - min fejl - den kan godt beregne de to felter (selfølgelig ;o]), men stadigvæk - den tager ikke højde for det med det variable antal spillere
Avatar billede medions Nybegynder
17. september 2003 - 15:47 #5
Det er jo bare at ændre lidt i det! -Prøv dig lidt frem til i aften, så ser vi hvad du har fundet ud af der!

//>Rune
Avatar billede avminarm Juniormester
18. september 2003 - 09:19 #6
jeg har prøvet og koge dit script ned til noget jeg kan overskue, men det vil ikke rigtig - det skal siges jeg har ikke brug for den samlede total i bunden - kun at der lægges sammen mod højre
Avatar billede avminarm Juniormester
18. september 2003 - 09:19 #7
hov - her er hvad jeg har prøvet med:

<head>
<script language="JavaScript">
function FindTotal(id) {
document.frm1.Total.value = parseInt(
document.frm1.result0.value + document.frm1.result1.value
);
}
</script>
</head>

Felter 0: tal + tal = noget<br>
<input type="text" name="quanity0" id="quanity0">
<input type="text" name="price0" id="price0" onblur="document.frm1.result0.value = parseInt(this.value) + parseInt(document.frm1.quanity0.value);">
<input type="text" name="result0" onblur="FindTotal(0);" readonly>

<br><br>


Felter 1: tal + tal = noget<br>
<input type="text" name="quanity1" id="quanity1">
<input type="text" name="price1" id="price1" onblur="document.frm1.result1.value = parseInt(this.value) + parseInt(document.frm1.quanity1.value);">
<input type="text" name="result1" onblur="FindTotal(1);" readonly>
Avatar billede avminarm Juniormester
18. september 2003 - 09:44 #8
hvis du har tid + lyst må du meget gerne prøve at bikse noget sammen ud fra den model jeg har lagt op - jeg skal nok selv prøve at lave noget der gør at det kan bruges med et variabelt antal spillere (jeg benytter PHP - så jeg kan bare lavet et loop ved hentningen fra DB)
Avatar billede avminarm Juniormester
22. september 2003 - 15:35 #9
lukker - du får 20 p for ulejligheden - ok?
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester