Hexagora Forum
Hexagora Forum
Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Other hexagora products
 Programs (Programmi)
 Script calculate
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

novak
Novice

5 Posts

Posted - 12 Nov 2007 :  12:57:20  Show Profile  Visit novak's Homepage  Reply with Quote
I would like add into script still one select so that it calucalion with other select together.
I can hepl me anywhere?


<script language="javascript" type="text/javascript">
<!--
var isNS=document.layers?true:false;
var isIE=(document.all!=null)||(navigator.userAgent.indexOf('MSIE')!=-1);
var isDom2=document.getElementById;
var fVers=parseFloat(navigator.appVersion);
if (!isDom2 && ((isNS && fVers<4)||(isIE && fVers<4)))
alert("Your browser is very old. Please upgrade it if you want to see this page correctly.");
//-->
</script>
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<script language="javascript" type="text/javascript" src="files/dhwe3x.js"></script>
<link rel="stylesheet" type="text/css" href="files/calculator.css">
<SCRIPT type=text/javascript>
var cenik = [
[1,650,600,550,550,500,380],
[1,700,650,600,600,550,420],
[1,720,670,620,620,570,450],
[1,750,700,650,650,600,470],
[1,790,740,690,690,640,484],
[1,820,750,710,710,660,510],
[1,1000,950,900,900,800,550],
[1,1200,1100,1000,1000,900,600],
[1,1290,1190,1090,1090,990,603],
[1,820,750,710,710,660,510],
[1,1250,1150,1050,1050,950,620],
[1,1450,1250,1150,1150,1050,650],
[1,1500,1400,1300,1300,1200,700],
[1,1600,1500,1400,1400,1300,750],
[1,1750,1650,1490,1490,1390,790],
[1,1900,1800,1600,1600,1500,820],
[1,2100,2000,1800,1800,1700,900],
]
// 1-3, 4-7, 8-8, 8-14, 14-29 ,
function currencyFormat(n, currencySign, currencySignPosition, decimalDivider, thousandsDivider, notForField) {
if (!isNaN(n)) {
if (!currencySign) {currencySign = false;}
if (!currencySignPosition) {currencySignPosition = false;}
if (!decimalDivider) {decimalDivider = ".";}
if (!thousandsDivider) {thousandsDivider = "";}
if (!notForField) {notForField = false;}

n = Math.round(n*10)/10;
n = n.toString();
nPart = n.split(".");

var x = nPart[0].substr(0, nPart[0].length%3);
for (var i = 0; i < Math.floor(nPart[0].length/3); i++) {
if ((nPart[0].length%3 != 0) || (i > 0)) {
x += thousandsDivider;
}
x += nPart[0].substr((nPart[0].length%3) + (i*3), 3);
}

if (!nPart[1]) {nPart[1] = "00";}
if (nPart[1].length == 1) {nPart[1] += "0";}
n = x;
if (currencySign) {
n = (currencySignPosition) ? currencySign + " " + n : n + " " + currencySign;
}
if (notForField) {
while (n.indexOf(" ") != -1) {
n = n.replace(" ", " ");
}
}
}
return n;
}
function Spocitej()
{
var priceType;

automobil = document.getElementById('Vyber_vozidla');
auto = automobil.selectedIndex;
pocetDni = document.getElementById('Pocet_dni').value;
cenaProVas = document.getElementById('Cena_pronajmu');
if (pocetDni>0&&pocetDni<5) {priceType = 1;}
else if (pocetDni>4&&pocetDni<8) {priceType = 2;}
else if (pocetDni>7&&pocetDni<15) {priceType = 3;}
else if (pocetDni>11&&pocetDni<15) {priceType = 4;}
else if (pocetDni>14&&pocetDni<30) {priceType = 5;}
else if (pocetDni>29&&pocetDni<366) {priceType = 6;}
else {priceType = 0;}
if (priceType == 0)
{
alert("Pros?m vypl?te pole PO?ET DN? (zadejte ??sla od 1 do 30)");
}
else
{
var b = (pocetDni * cenik[auto][priceType]);
var a = currencyFormat(b, ',-', false, '', ' ');
cenaProVas.value = a;
}
return false;
}
</SCRIPT>
<script language='JavaScript' src='scripts/genvalidationv5.js'>
</script>
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#0000FF" alink="#FF0000" vlink="#800080">
<div id="D.H.E.centerdiv1" align="left">
<div id="lD.H.E.pocetdni" style="position: absolute; left: 24px; top: 70px;" align="left">
<input type="text" id="Pocet_dni" name="Pocet_dni" style="width: 44px; height: 22px;" value="" maxlength="255">
</div>
<div id="lD.H.E.cenaprovas" style="position: absolute; left: 24px; top: 101px;" align="left">
<input type="text" id="Cena_pronajmu" name="Cena_pronajmu" style="width: 74px; height: 22px;" value="" maxlength="255">
</div>
<div id="lD.H.E.Spocitat" style="position: absolute; left: 24px; top: 138px;" align="left">
<input type="button" id="Spocitat" name="Spocitat" style="width: 82px; height: 28px;" onclick="Spocitej();return false;" value="Spo??tat" value="Spocitat">
</div>
<div id="lD.H.E.vymazat" style="position: absolute; left: 118px; top: 138px;" align="left">
<input type="reset" id="vymazat" name="vymazat" style="width: 87px; height: 28px;" value="Vymazat">
</div>
<div id="lD.H.E.automobil" style="position: absolute; left: 24px; top: 38px;" align="left">
<select id="Vyber_vozidla" name="Vyber_vozidla" style="width: 315px;" class="textura">
<option value="Skoda Fabia 1.2 40 kw" selected="">?koda Fabia 1.2 40 kw
</option>
<option value="Skoda Fabia ClassIc 1.2 12V">?koda Fabia Classic 1.2 12V 47 kW
</option>
<option value="Skoda Fabia Elegance 1.2 47 kW ">?koda Fabia Elegance 1.2 47 kW
</option>
<option value="Skoda Fabia Combi 1.2 40 kw">?koda Fabia Combi 1.2 40 kw
</option>
<option value="Skoda Fabia Combi Ambiente 1.4 TDI 55 kW">?koda Fabia Combi Ambiente 1.4 TDI 55 kW
</option>
<option value="VW Caddy 1.9 TDI 77 kW">VW Caddy 1.9 TDI 77 kW
</option>
<option value="Skoda Octavia Ambiente 1.6 74 kW ">?koda Octavia Ambiente 1.6 74 kW
</option>
<option value="Skoda Octavia Ambiente Combi 1.6 74 kW ">?koda Octavia Ambiente Combi 1.6 74 kW
</option>
<option value="Skoda Octavia combi Tour 1.9 TDI 66 kW">?koda Octavia combi Tour 1.9 TDI 66 kW
</option>
<option value="Skoda Roomster Style 1.9 TDI 77 kW">?koda Roomster Style 1.9 TDI 77 kW
</option>
<option value="?koda OctaviaII. Ambiente 1.6 MPI 75 kW">?koda OctaviaII. Ambiente 1.6 MPI 75 kW
</option>
<option value="Skoda OctaviaII. Ambiente 1.9 TDI 77 kW ">?koda OctaviaII. Ambiente 1.9 TDI 77 kW
</option>
<option value="Skoda OctaviaII.combi. Ambiente 1.9 TDI 77 kW ">?koda OctaviaII Combi Ambiente 1.9 TDI 77 kW
</option>
<option value="Skoda OctaviaII. Elegance 1.9 TDI 77 kW ">?koda OctaviaII. Elegance 1.9 TDI 77 kW
</option>
<option value="Skoda OctaviaII. Elegance Combi 1.9 TDI 77 kW">?koda OctaviaII. Combi Elegance 1.9 TDI 77 kW
</option>
<option value="Skoda SuperB Classic 1.9 TDI 96 kW ">?koda SuperB Classic 1.9 TDI 96 kW
</option>
<option value="Skoda SuperB Comfort 2.0 TDI">?koda SuperB Comfort 2.0 TDI 103 kW
</option>
</select>
</div>

s.dav
Site Admin

Italy
3364 Posts

Posted - 12 Nov 2007 :  14:48:03  Show Profile  Visit s.dav's Homepage  Reply with Quote
Sorry I don't understand

Regards, Davide
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Hexagora Forum © s.dav Go To Top Of Page
Snitz Forums 2000