Bestellungsformular "Preis"

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Bestellungsformular "Preis"

    Sie baue seid gestern für ein Kunden von mir ein Bestellsystem mit JS, nun ist jedoch da so das die Funktion wohl nicht aufgerufen würd.

    Dazu muss ich noch sagen, das ich gerade nur Paar Sachen in JS behersche (dazu gehört das aber noch nicht)

    JavaScript-Quellcode

    1. <script language="JavaScript" type="text/javascript">
    2. function createprice(){
    3. var fullp = 0.00;
    4. var months = 0;
    5. if (document.getElementById("varid3").value == 1) {
    6. months = 0;
    7. }
    8. if (document.getElementById("varid3").value == 2) {
    9. months = 3;
    10. }
    11. if (document.getElementById("varid3").value == 6) {
    12. months = 10;
    13. }
    14. if (document.getElementById("varid0").value == 2) {
    15. var varid0 = 4.50;
    16. }
    17. if (document.getElementById("varid0").value == 3) {
    18. var varid0 = 6.50;
    19. }
    20. if (document.getElementById("varid0").value == 4) {
    21. var varid0 = 8.50;
    22. }
    23. if (document.getElementById("varid0").value == 6) {
    24. var varid0 = 13.00;
    25. }
    26. if (document.getElementById("varid0").value == 8) {
    27. var varid0 = 17.50;
    28. }
    29. if (document.getElementById("varid0").value == 12) {
    30. var varid0 = 25.00;
    31. }
    32. if (document.getElementById("varid0").value == 16) {
    33. var varid0 = 32.50;
    34. }
    35. if (document.getElementById("varid0").value == 24) {
    36. var varid0 = 50.00;
    37. }
    38. if (document.getElementById("varid1").value == 1) {
    39. var varid1 = 0.00;
    40. }
    41. if (document.getElementById("varid1").value == 2) {
    42. var varid1 = 4.00;
    43. }
    44. if (document.getElementById("varid2").value == 298) {
    45. var varid2 = 0.00;
    46. }
    47. if (document.getElementById("varid2").value == 299) {
    48. var varid2 = -1.50;
    49. }
    50. if (document.getElementById("varid4").value == 5) {
    51. var perid4 = +3.00;
    52. }
    53. if (document.getElementById("varid4").value == 10) {
    54. var perid4 = +6.00;
    55. }
    56. if (document.getElementById("varid4").value == 15) {
    57. var perid4 = +9.00;
    58. }
    59. if (document.getElementById("varid4").value == 20) {
    60. var perid4 = +12.00;
    61. }
    62. if (document.getElementById("varid4").value == 25) {
    63. var perid4 = +15.00;
    64. }
    65. if (document.getElementById("varid4").value == 35) {
    66. var perid4 = +21.00;
    67. }
    68. if (document.getElementById("varid4").value == 50) {
    69. var perid4 = +30.00;
    70. }
    71. if (document.getElementById("varid4").value == 60) {
    72. var perid4 = +35.00;
    73. }
    74. if (document.getElementById("varid5").value == 0) {
    75. var perid5 = +0.00;
    76. }
    77. if (document.getElementById("varid5").value == 1) {
    78. var perid5 = +1.50;
    79. }
    80. if (document.getElementById("varid6").value == 1) {
    81. var perid6 = +0.00;
    82. }
    83. if (document.getElementById("varid6").value == 2) {
    84. var perid6 = +1.00;
    85. }
    86. if (document.getElementById("varid6").value == 3) {
    87. var perid6 = +2.00;
    88. }
    89. if (document.getElementById("varid6").value == 4) {
    90. var perid6 = +3.00;
    91. }
    92. perprice = perid0;
    93. calcprice = fullp + varid0 + varid1 + varid2 + perid4 + perid5 + perid6;
    94. calcprice = calcprice * perprice / 100 + calcprice;
    95. alert("all");
    96. calcprice = calcprice.toFixed(2);
    97. calcprice = calcprice.replace(".",",");
    98. document.cprice.moneytotal.value = calcprice +" €" +" inkl. MwSt.";
    99. }
    Alles anzeigen


    und so ist der HTML teil

    HTML-Quellcode

    1. <table border="1">
    2. <tr>
    3. <th>Ram:</th>
    4. <th>
    5. <select name="varid[]" id="varid0" onChange="createprice()">
    6. <option value="2">2 GB (+4,50€)</option>
    7. <option value="3">3 GB (+6,50€)</option>
    8. <option value="4">4 GB (+8,50€)</option>
    9. <option value="6">6 GB (+13,00€)</option>
    10. <option value="8">8 GB (+17,50€)</option>
    11. <option value="16">16 GB (+32,50€)</option>
    12. <option value="12">12 GB (+25,00€)</option>
    13. <option value="24">24 GB (+50,00€)</option>
    14. </select>
    15. </th>
    16. </tr>
    17. <tr>
    18. <th>Vorauszahlung:</th>
    19. <th>
    20. <select name="varid[]" id="varid3" onChange="createprice()">
    21. <option value="1">1 Monat (-0%)</option>
    22. <option value="2">3 Monate (-3%)</option>
    23. <option value="6">6 Monate (-10%)</option>
    24. </select>
    25. </th>
    26. </tr>
    27. <tr>
    28. <th>Festplatte:</th>
    29. <th>
    30. <select name="varid4" id="varid4" onChange="createprice()">
    31. <option value="5">5GB-SSD ( +3.00€ )</option>
    32. <option value="10">10GB-SSD ( +6.00€ )</option>
    33. <option value="15">15GB-SSD ( +9.00€ )</option>
    34. <option value="20">20GB-SSD ( +12.00€ )</option>
    35. <option value="25">25GB-SSD ( +15.00€ )</option>
    36. <option value="35">35GB-SSD ( +21.00€ )</option>
    37. <option value="50">50GB-SSD ( +30.00€ )</option>
    38. <option value="60">60GB-SSD ( +35.00€ )</option>
    39. </select>
    40. </th>
    41. </tr>
    42. <tr>
    43. <th>Standartport: (25565)</th>
    44. <th>
    45. <select name="varid5" id="varid5" onChange="createprice()">
    46. <option value="0">Nein ( +0.00€ )</option>
    47. <option value="1">Ja ( +1.50€)</option>
    48. </select>
    49. </th>
    50. </tr>
    51. <tr>
    52. <th>Datenbank:</th>
    53. <th>
    54. <select name="varid6" id="varid6" onChange="createprice()">
    55. <option value="1">1 Datenbank ( +0.00€ )</option>
    56. <option value="2">2 Datenbanken( +1.00€)</option>
    57. <option value="3">3 Datenbanken( +2.00€ )</option>
    58. <option value="4">4 Datenbanken( +3.00€)</option>
    59. </select>
    60. </th>
    61. </tr>
    62. </table>
    63. <input type="text" id="moneytotal" style="border:0px solid;background:none;width:150px;" value="">
    Alles anzeigen