|
|
|
| Есть код:
<HTML>
<HEAD>
<title>Shop</title>
<script language=JavaScript>
function def_f1()
{
document.f1.s1.options[0] = new Option("альтернатива Один","",true,true);
document.f1.s1.options[1] = new Option("альтернатива Два");
document.f1.s1.options[2] = new Option("альтернатива Три");
return false;
}
function change_model()
{
for(i=document.f2.s1.length;i>0;i--) document.f2.s1.options[i] = null;
if(document.f2.s0.selectedIndex==0)
{
// Acura
document.f2.s1.options[0] = new Option("MDX","",true,true);
document.f2.s1.options[1] = new Option("RDX");
document.f2.s1.options[2] = new Option("RL");
document.f2.s1.options[3] = new Option("TL(2009)");
document.f2.s1.options[4] = new Option("TSX");
}
if(document.f2.s0.selectedIndex==1)
{
// Audi
document.f2.s1.options[0] = new Option("A3","",true,true);
document.f2.s1.options[1] = new Option("A3 Sportback");
document.f2.s1.options[2] = new Option("A3 Kabriolet");
document.f2.s1.options[3] = new Option("A4 AllRoad");
document.f2.s1.options[4] = new Option("A4 Kabriolet");
document.f2.s1.options[5] = new Option("A4 Sedan");
document.f2.s1.options[6] = new Option("A4 Sedan(2009)");
document.f2.s1.options[7] = new Option("A4 Universal");
document.f2.s1.options[8] = new Option("A4 Universal(2009)");
document.f2.s1.options[9] = new Option("A5");
document.f2.s1.options[10] = new Option("A5 Sportback");
document.f2.s1.options[11] = new Option("A5 Kabriolet");
}
if(document.f2.s0.selectedIndex==2)
{
// BMW
document.f2.s1.options[0] = new Option("1 Series Kabriolet (E81)","",true,true);
document.f2.s1.options[1] = new Option("1 Series Cupe (E82)");
document.f2.s1.options[2] = new Option("1 Series Hatchback 3dr (E81)");
document.f2.s1.options[3] = new Option("1 Series Hatchback 5dr (E87)");
document.f2.s1.options[4] = new Option("1 Series Touring (E91)");
}
if(document.f2.s2.selectedIndex==3)
{
// Kovrolin
document.f2.s2.options[0] = new Option("VIP 1","",true,true);
document.f2.s2.options[1] = new Option("VIP 2");
document.f2.s2.options[2] = new Option("VIP 3");
document.f2.s2.options[3] = new Option("Standart 1");
document.f2.s2.options[4] = new Option("Standart 2");
document.f2.s2.options[5] = new Option("Standart 3");
document.f2.s2.options[6] = new Option("Ekonom 1");
document.f2.s2.options[7] = new Option("Ekonom 2");
document.f2.s2.options[8] = new Option("Ekonom 3");
}
if(document.f2.s3.selectedIndex==4)
{
// Tsvet
document.f2.s3.options[0] = new Option("Red","",true,true);
document.f2.s3.options[1] = new Option("Yelow");
document.f2.s3.options[2] = new Option("Blue");
document.f2.s3.options[3] = new Option("Pink");
}
if(document.f2.s4.selectedIndex==5)
{
// Okontovka
document.f2.s4.options[0] = new Option("Tesma","",true,true);
document.f2.s4.options[1] = new Option("Nita");
}
if(document.f2.s5.selectedIndex==6)
{
// Nadpis
document.f2.s5.options[0] = new Option("Vishivka","",true,true);
document.f2.s5.options[1] = new Option("Flog");
}
}
function auto()
{
for(i=document.f2.s1.length;i>0;i--) document.f2.s1.options[i] = null;
document.f2.s0.options[0].selected = true;
for(i=document.f2.s2.length;i>0;i--) document.f2.s2.options[i] = null;
document.f2.s0.options[0].selected = true;
for(i=document.f2.s3.length;i>0;i--) document.f2.s3.options[i] = null;
document.f2.s0.options[0].selected = true;
for(i=document.f2.s4.length;i>0;i--) document.f2.s4.options[i] = null;
document.f2.s0.options[0].selected = true;
for(i=document.f2.s5.length;i>0;i--) document.f2.s5.options[i] = null;
document.f2.s0.options[0].selected = true;
document.f2.s1.options[0] = new Option("MDX","",true,true);
document.f2.s1.options[1] = new Option("RDX");
document.f2.s1.options[2] = new Option("RL");
document.f2.s1.options[3] = new Option("TL(2009)");
document.f2.s1.options[4] = new Option("TSX");
document.f2.s1.options[0].selected = true;
document.f2.s2.options[0] = new Option("VIP 1","",true,true);
document.f2.s2.options[1] = new Option("VIP 2");
document.f2.s2.options[2] = new Option("VIP 3");
document.f2.s2.options[3] = new Option("Standart 1");
document.f2.s2.options[4] = new Option("Standart 2");
document.f2.s2.options[5] = new Option("Standart 3");
document.f2.s2.options[6] = new Option("Ekonom 1");
document.f2.s2.options[7] = new Option("Ekonom 2");
document.f2.s2.options[8] = new Option("Ekonom 3");
document.f2.s3.options[0] = new Option("Red","",true,true);
document.f2.s3.options[1] = new Option("Yelow");
document.f2.s3.options[2] = new Option("Blue");
document.f2.s3.options[3] = new Option("Pink");
document.f2.s4.options[0] = new Option("Tesma","",true,true);
document.f2.s4.options[1] = new Option("Nita");
document.f2.s5.options[0] = new Option("Vishivka","",true,true);
document.f2.s5.options[1] = new Option("Flog");
document.f2.i0.value = "";
document.f2.i1.value = "";
document.f2.i2.value = "";
document.f2.i3.value = "";
document.f2.i4.value = "";
return false;
}
function take()
{
document.f2.i0.value = document.f2.s1[document.f2.s1.selectedIndex].text;
document.f2.i1.value = document.f2.s2[document.f2.s2.selectedIndex].text;
document.f2.i2.value = document.f2.s3[document.f2.s3.selectedIndex].text;
document.f2.i3.value = document.f2.s4[document.f2.s4.selectedIndex].text;
document.f2.i4.value = document.f2.s5[document.f2.s5.selectedIndex].text;
return false;
}
function out()
{
document.f3.i0.blur();
}
</script>
<style type="text/css">
<!--
.стиль1 {
font-size: 18px;
font-weight: bold;
}
-->
</style>
</head>
<form name=f2 onReset="return auto();" onSubmit="return take();">
Marka:
<p>
<select name=s0 onChange="change_model()">
<option selected>Acura
<option>Audi
<option>BMW
</select>
<p>
Model:
<p>
<select name=s1>
<option value="">MDX
<option value="">RDX
<option value="">RL
<option value="">TL(2009)
<option value="">TSX
</select>
<p>
Kovrolin:
<p>
<select name=s2>
<option value="">VIP 1
<option value="">VIP 2
<option value="">VIP 3
<option value="">Standart 1
<option value="">Standart 2
<option value="">Standart 3
<option value="">Ekonom 1
<option value="">Ekonom 2
<option value="">Ekonom 3
</select>
<p>
Tsvet:
<p>
<select name=s3>
<option>Red
<option>Yelow
<option>Blue
<option>Pink
</select>
<p>
Okantovka:
<p>
<select name=s4>
<option>Tesma
<option>Nita
</select>
<p>
Nadpis:
<p>
<select name=s5>
<option>Vishivka
<option>Flog
</select>
<p>
<input type=reset value=Отмена>
<input type=submit value=Заказ>
<p align="left" class="стиль1"> Сделан заказ на
</p>
<div align="left">
<table width="268" border="1">
<tr>
<td width="72">Модель</td>
<td width="180"><input name="i0" type="text" value="" size="30"></td>
</tr>
<tr>
<td>Ковролин</td>
<td><input name="i1" type="text" value="" size="30"></td>
</tr>
<tr>
<td>Цвет</td>
<td><input name="i2" type="text" value="" size="30"></td>
</tr>
<tr>
<td>Окантовка</td>
<td><input name="i3" type="text" value="" size="30"></td>
</tr>
<tr>
<td>Надпись</td>
<td><input name="i4" type="text" value="" size="30"></td>
</tr>
<tr>
<td>Цена</td>
<td><input ?СУММА? ></td>
</tr>
</table>
</div>
</form>
</span></div>
</body>
</HTML>
Помогите, пожалуйста, определить сумму заказа(Модель + Ковролин) и перевести заказ на внутреннюю почту. Буду благодарен, готов заплатить!!! | |
|
|
|
|
|
|
|
для: cor4
(15.10.2009 в 11:41)
| | Сделал вывод суммы. Сумма ставится в value=**** около нужных параметров.
Отправку на почту, не делал.
<HTML>
<HEAD>
<title>Shop</title>
<script language=JavaScript>
function def_f1()
{
document.f1.s1.options[0] = new Option("альтернатива Один","",true,true);
document.f1.s1.options[1] = new Option("альтернатива Два");
document.f1.s1.options[2] = new Option("альтернатива Три");
return false;
}
function change_model()
{
for(i=document.f2.s1.length;i>0;i--) document.f2.s1.options[i] = null;
if(document.f2.s0.selectedIndex==0)
{
// Acura
document.f2.s1.options[0] = new Option("MDX","",true,true);
document.f2.s1.options[1] = new Option("RDX");
document.f2.s1.options[2] = new Option("RL");
document.f2.s1.options[3] = new Option("TL(2009)");
document.f2.s1.options[4] = new Option("TSX");
}
if(document.f2.s0.selectedIndex==1)
{
// Audi
document.f2.s1.options[0] = new Option("A3","66666666",true,true);
document.f2.s1.options[1] = new Option("A3 Sportback","3453223534");
document.f2.s1.options[2] = new Option("A3 Kabriolet");
document.f2.s1.options[3] = new Option("A4 AllRoad");
document.f2.s1.options[4] = new Option("A4 Kabriolet");
document.f2.s1.options[5] = new Option("A4 Sedan");
document.f2.s1.options[6] = new Option("A4 Sedan(2009)");
document.f2.s1.options[7] = new Option("A4 Universal");
document.f2.s1.options[8] = new Option("A4 Universal(2009)");
document.f2.s1.options[9] = new Option("A5");
document.f2.s1.options[10] = new Option("A5 Sportback");
document.f2.s1.options[11] = new Option("A5 Kabriolet");
}
if(document.f2.s0.selectedIndex==2)
{
// BMW
document.f2.s1.options[0] = new Option("1 Series Kabriolet (E81)","",true,true);
document.f2.s1.options[1] = new Option("1 Series Cupe (E82)");
document.f2.s1.options[2] = new Option("1 Series Hatchback 3dr (E81)");
document.f2.s1.options[3] = new Option("1 Series Hatchback 5dr (E87)");
document.f2.s1.options[4] = new Option("1 Series Touring (E91)");
}
if(document.f2.s2.selectedIndex==3)
{
// Kovrolin
document.f2.s2.options[0] = new Option("VIP 1","",true,true);
document.f2.s2.options[1] = new Option("VIP 2");
document.f2.s2.options[2] = new Option("VIP 3");
document.f2.s2.options[3] = new Option("Standart 1");
document.f2.s2.options[4] = new Option("Standart 2");
document.f2.s2.options[5] = new Option("Standart 3");
document.f2.s2.options[6] = new Option("Ekonom 1");
document.f2.s2.options[7] = new Option("Ekonom 2");
document.f2.s2.options[8] = new Option("Ekonom 3");
}
if(document.f2.s3.selectedIndex==4)
{
// Tsvet
document.f2.s3.options[0] = new Option("Red","",true,true);
document.f2.s3.options[1] = new Option("Yelow");
document.f2.s3.options[2] = new Option("Blue");
document.f2.s3.options[3] = new Option("Pink");
}
if(document.f2.s4.selectedIndex==5)
{
// Okontovka
document.f2.s4.options[0] = new Option("Tesma","",true,true);
document.f2.s4.options[1] = new Option("Nita");
}
if(document.f2.s5.selectedIndex==6)
{
// Nadpis
document.f2.s5.options[0] = new Option("Vishivka","",true,true);
document.f2.s5.options[1] = new Option("Flog");
}
}
function auto()
{
for(i=document.f2.s1.length;i>0;i--) document.f2.s1.options[i] = null;
document.f2.s0.options[0].selected = true;
for(i=document.f2.s2.length;i>0;i--) document.f2.s2.options[i] = null;
document.f2.s0.options[0].selected = true;
for(i=document.f2.s3.length;i>0;i--) document.f2.s3.options[i] = null;
document.f2.s0.options[0].selected = true;
for(i=document.f2.s4.length;i>0;i--) document.f2.s4.options[i] = null;
document.f2.s0.options[0].selected = true;
for(i=document.f2.s5.length;i>0;i--) document.f2.s5.options[i] = null;
document.f2.s0.options[0].selected = true;
document.f2.s1.options[0] = new Option("MDX","",true,true);
document.f2.s1.options[1] = new Option("RDX");
document.f2.s1.options[2] = new Option("RL");
document.f2.s1.options[3] = new Option("TL(2009)");
document.f2.s1.options[4] = new Option("TSX");
document.f2.s1.options[0].selected = true;
document.f2.s2.options[0] = new Option("VIP 1","",true,true);
document.f2.s2.options[1] = new Option("VIP 2");
document.f2.s2.options[2] = new Option("VIP 3");
document.f2.s2.options[3] = new Option("Standart 1");
document.f2.s2.options[4] = new Option("Standart 2");
document.f2.s2.options[5] = new Option("Standart 3");
document.f2.s2.options[6] = new Option("Ekonom 1");
document.f2.s2.options[7] = new Option("Ekonom 2");
document.f2.s2.options[8] = new Option("Ekonom 3");
document.f2.s3.options[0] = new Option("Red","",true,true);
document.f2.s3.options[1] = new Option("Yelow");
document.f2.s3.options[2] = new Option("Blue");
document.f2.s3.options[3] = new Option("Pink");
document.f2.s4.options[0] = new Option("Tesma","",true,true);
document.f2.s4.options[1] = new Option("Nita");
document.f2.s5.options[0] = new Option("Vishivka","",true,true);
document.f2.s5.options[1] = new Option("Flog");
document.f2.i0.value = "";
document.f2.i1.value = "";
document.f2.i2.value = "";
document.f2.i3.value = "";
document.f2.i4.value = "";
document.f2.i5.value = "";
return false;
}
function take()
{
document.f2.i0.value = document.f2.s1[document.f2.s1.selectedIndex].text;
document.f2.i1.value = document.f2.s2[document.f2.s2.selectedIndex].text;
document.f2.i2.value = document.f2.s3[document.f2.s3.selectedIndex].text;
document.f2.i3.value = document.f2.s4[document.f2.s4.selectedIndex].text;
document.f2.i4.value = document.f2.s5[document.f2.s5.selectedIndex].text;
document.f2.i5.value = parseInt(document.f2.s1[document.f2.s1.selectedIndex].value)+parseInt(document.f2.s2[document.f2.s2.selectedIndex].value);
return false;
}
function out()
{
document.f3.i0.blur();
}
</script>
<style type="text/css">
<!--
.стиль1 {
font-size: 18px;
font-weight: bold;
}
-->
</style>
</head>
<form name=f2 onReset="return auto();" onSubmit="return take();">
Marka:
<p>
<select name=s0 onChange="change_model()">
<option selected>Acura
<option>Audi
<option>BMW
</select>
<p>
Model:
<p>
<select name=s1>
<option value="9999">MDX
<option value="55555">RDX
<option value="33333">RL
<option value="">TL(2009)
<option value="">TSX
</select>
<p>
Kovrolin:
<p>
<select name=s2>
<option value="200">VIP 1
<option value="300">VIP 2
<option value="400">VIP 3
<option value="">Standart 1
<option value="">Standart 2
<option value="">Standart 3
<option value="">Ekonom 1
<option value="">Ekonom 2
<option value="">Ekonom 3
</select>
<p>
Tsvet:
<p>
<select name=s3>
<option>Red
<option>Yelow
<option>Blue
<option>Pink
</select>
<p>
Okantovka:
<p>
<select name=s4>
<option>Tesma
<option>Nita
</select>
<p>
Nadpis:
<p>
<select name=s5>
<option>Vishivka
<option>Flog
</select>
<p>
<input type=reset value=Отмена>
<input type=submit value=Заказ>
<p align="left" class="стиль1"> Сделан заказ на
</p>
<div align="left">
<table width="268" border="1">
<tr>
<td width="72">Модель</td>
<td width="180"><input name="i0" type="text" value="" size="30"></td>
</tr>
<tr>
<td>Ковролин</td>
<td><input name="i1" type="text" value="" size="30"></td>
</tr>
<tr>
<td>Цвет</td>
<td><input name="i2" type="text" value="" size="30"></td>
</tr>
<tr>
<td>Окантовка</td>
<td><input name="i3" type="text" value="" size="30"></td>
</tr>
<tr>
<td>Надпись</td>
<td><input name="i4" type="text" value="" size="30"></td>
</tr>
<tr>
<td>Цена</td>
<td><input name="i5" type="text" value="" size="30"></td>
</tr>
</table>
</div>
</form>
</span></div>
</body>
</HTML>
|
| |
|
|
|
|