Avatar billede juhl0 Nybegynder
01. december 1999 - 20:44 Der er 2 kommentarer og
2 løsninger

Tjen penge lav en indkøbskurv i java til mig

Hej jeg mangler en indkøbskurv....i jave...til min hjemmeside.....Du kan nok få en rimelig pris....
den er til http://www.123mp3.dk
Skriv til Lasse@123mp3.dk
Avatar billede spacey Nybegynder
01. december 1999 - 21:20 #1
you've got mail
Avatar billede kirkeby Nybegynder
02. december 1999 - 23:53 #2
JEg har en fin en liggende der virker perfekt...  kontakt mig på jkp@jkp.dk hvis du er interesseret...
Avatar billede Slettet bruger
28. februar 2000 - 11:03 #3
Denne er lavet i Javascript, der mangler lidt på den, men det der er virker.
Hvis du har fået fra de andre burde du accepterer nogle af dine svar.

<html>
<head>
<style>
<!--
LI { font-family: Arial, sans-serif; color: #009;}
H1 { font-family: Bauhaus 93, sans-serif ; font-size: 50px;}
TD { font-family: Arial, sans-serif; color: #009;}
TH { font-family: Arial, sans-serif; background-color: #cff;
      border: 1 solid black }
-->
</style>
<script language="JavaScript">
<!--
function ckBrowser(){
  browser = navigator.appName.substring(0,9);
  version = parseInt(navigator.appVersion);
  if ((browser != "Microsoft") || (version < 4)){
    alert("Warning!\n" +
          "This page requries Internet Explorer 4.0.")
  }
}
function addItm(){
  qty = document.ordFm.txtQty.value;
  if ((qty < 1) || isNaN(qty)){
    alert("Please specify a valid quantity.");
    return;
  }
  sel = document.ordFm.ddItm.selectedIndex;
  itm = document.ordFm.ddItm.options(sel).text;
  sel = document.ordFm.ddClr.selectedIndex;
  clr = document.ordFm.ddClr.options(sel).text;
  sel = document.ordFm.ddSiz.selectedIndex;
  siz = document.ordFm.ddSiz.options(sel).text;
  prc = document.ordFm.ddItm.value;
  newRow = document.all.ordTb.insertRow(2);
  rowNr = newRow.rowIndex;
  document.all.ordTb.rows[rowNr].insertCell(0);
  document.all.ordTb.rows[rowNr].cells[0].style.textAlign
      = "right";
  document.all.ordTb.rows[rowNr].cells[0].innerText = qty;
  newCell = document.all.ordTb.rows[rowNr].insertCell(1);
  document.all.ordTb.rows[rowNr].cells[1].innerText = itm;
  document.all.ordTb.rows[rowNr].insertCell(2);
  document.all.ordTb.rows[rowNr].cells[2].innerText = clr;
  document.all.ordTb.rows[rowNr].insertCell(3);
  document.all.ordTb.rows[rowNr].cells[3].innerText = siz;
  document.all.ordTb.rows[rowNr].insertCell(4);
  document.all.ordTb.rows[rowNr].cells[4].style.textAlign
      = "right";
  document.all.ordTb.rows[rowNr].cells[4].innerText
      = fmtMoney(prc);
  document.all.ordTb.rows[rowNr].insertCell(5);
  document.all.ordTb.rows[rowNr].cells[5].style.textAlign
      = "right";
  document.all.ordTb.rows[rowNr].cells[5].innerText
      = fmtMoney(qty * prc);
  rows = document.all.ordTb.rows.length;
  tot = 0;
  for (rw=2; rw < rows-1; ++rw){
    rwPrc = document.all.ordTb.rows[rw].cells[5].innerText;
    if (rwPrc.substring(0,1) == "$"){
        rwPrc = rwPrc.substring(1,rwPrc.length);
    }
    tot = tot + parseFloat(rwPrc);
  }
  document.all.ordTb.rows[rows-1].cells[5].innerText
      = fmtMoney(tot);
}
function fmtMoney(amt){
  cents = Math.round(amt * 100);
  if (cents < 10){
    cents = "$00" + cents;
  }else{
    if (cents < 100){
      cents="$0" + cents;
    }else{
      cents="$" + cents;
    }
  }
  bucks = cents.substring(0,cents.length - 2) + "."
        + cents.substring(cents.length - 2, cents.length);
  return bucks;
}
function bordOn(){
  document.all.tab1.border = "2" ;
  document.all.tab2.border = "2" ;
  document.all.ordTb.border = "2" ;
}
function bordOff(){
  document.all.tab1.border = "0" ;
  document.all.tab2.border = "0" ;
  document.all.ordTb.border = "0" ;
}
// -->
</script>
<title>Clothes on Line</title>
</head>
<body onload="ckBrowser();">
<h1 align="center">
  <img src="../images/cpin3.gif" alt="Clothes on Line"
      align="absmiddle" width="58" height="59"
      ondblclick="bordOn();"
      onmouseout="bordOff();">
  Clothes
  <img src="../images/cpin1.gif" alt="Clothes on Line"
      align="absmiddle" width="68" height="59">
  on
  <img src="../images/cpin4.gif" alt="Clothes on Line"
      align="absmiddle" width="68" height="59">
  Line
  <img src="../images/cpin2.gif" alt="Clothes on Line"
  align="absmiddle" width="58" height="59"></h1>
<ol>
  <li>Specify Quantity, Item, Color, and Size for each
      item you wish to order.</li>
  <li>Click the Submit button when your order is complete.</li>
</ol>
<table id="tab1" cellpadding="2" cellspacing="0"
        border="0" bordercolor="#009900" >
<tr>
  <td valign="top">
  <form name="ordFm">
    <table id="tab2" cellspacing="4" cellpadding="2"
          border="0" bordercolor="#000000">
    <tr>
      <th colspan="5">Our Items</th>
      <td><img src="../images/trans5x5.gif"
              width="5" height="5"></td>
    </tr><tr>
      <th>Qty</th>
      <th>Item</th>
      <th>Color</th>
      <th>Size</th>
      <th align="center">Action</th>
      <td>&nbsp;</td>
    </tr><tr>
      <td>
        <input type="text" name="txtQty"
              size="5" value="1"></td>
      <td>
        <select name="ddItm" size="1">
          <option value="30">Backpack</option>
          <option value="5">Bandana</option>
          <option value="12">Hat</option>
          <option value="25">Sweatshirt</option>
          <option value="15">T-Shirt</option>
        </select></td>
      <td>
        <select name="ddClr" size="1">
          <option value="Ash">Ash</option>
          <option value="Black">Black</option>
          <option value="Blue">Blue</option>
          <option value="Green">Green</option>
          <option value="Red">Red</option>
          <option value="White">White</option>
        </select></td>
      <td>
        <select name="ddSiz" size="1">
          <option value="Small">Small</option>
          <option value="Medium">Medium</option>
          <option value="Large">Large</option>
          <option value="X-Large">X-Large</option>
        </select></td>
      <td align="center">
        <input type="button" value="Order" name="ordBtn"
              onclick="addItm()"></td>
      <td>&nbsp;</td>
    </tr><tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><img src="../images/trans5x5.gif"
              width="5" height="20"></td>
      <td>&nbsp;</td>
    </tr><tr>
      <td>&nbsp;</td>
      <td colspan="3" align="right">When done:</td>
      <td valign="top" align="center">
        <input type="button" value="Submit" name="subBtn"
              onclick="alert('Sorry, this is just a demo. '
                            + 'Try the mall.');"></td>
      <td>&nbsp;</td>
    </tr></table>
  </form></td>
  <td valign="top">
    <table id="ordTb" cellpadding="2" cellspacing="4"
          border="0" bordercolor="#000000">
    <tr>
      <th colspan="6">Your Order</th>
    </tr><tr>
      <th>Qty</th>
      <th nowrap>Item</th>
      <th>Color</th>
      <th>Size</th>
      <th>Price</th>
      <th>Total</th>
    </tr><tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <th>$</th>
    </tr>
    </table>
  </td>
</tr>
</table>
</body>
</html>
Avatar billede steen_hansen Forsker
25. januar 2002 - 06:14 #4
spacemaniac: Har du nogen ide om, hvor man får fat i backpack? http://www.eksperten.dk/spm/161494. Den må gerne være til en USB-port.
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
Alle kurser indenfor Microsoft 365 – både til begyndere og øvede.

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