А вот мои каракули JS
<script type="text/javascript">
if ( window.addEventListener ) {
document.addEventListener('DOMContentLoaded',function() {
var x_dom = document.getElementById('x'),
y_dom = document.getElementById('y'),
result_dom = document.getElementById('result'),
values = document.getElementsByClassName('value');
if ( values ) {
for ( var i = 0, l = values.length; i < l; i++ ) {
values[i].addEventListener( 'input', function( event ) {
if ( result_dom ) {
result_dom.innerHTML = calculate( parseInt(x_dom.value) || 0, parseInt(y_dom.value) || 0);
}
event.stopPropagation()
}, true );
}
}
});
} else if ( window.attachEvent ) { alert ( 'Ваш IE погружает меня в пучины отчаяния!!!' ) };
function calculate (x,y) {
var result;
if (x >= 2 && x <= 50 && y >= 0 && y <= 1)
{
result = x*200+x*35;
}
else if (x >= 51 && x <= 150 && y >= 0 && y <= 1)
{
result = x*180+x*35;
}
else if (x >= 151 && x < 9999 && y >= 0 && y <= 1)
{
result = x*170+x*35;
}
else if (x >= 2 && x <= 50 && y >= 1.1 && y <= 4)
{
result = x*215+x*35;
}
else if (x >= 51 && x <= 150 && y >= 1.1 && y <= 4)
{
result = x*190+x*35;
}
else if (x >= 151 && x < 9999 && y >= 1.1 && y <= 4)
{
result = x*180+x*35;
}
else if (x >= 2 && x <= 50 && y >= 4.1 && y <= 8)
{
result = x*250+x*35;
}
else if (x >= 51 && x <= 150 && y >= 4.1 && y <= 8)
{
result = x*230+x*35;
}
else if (x >= 151 && x < 9999 && y >= 4.1 && y <= 8)
{
result = x*200+x*35;
}
else if (x >= 2 && x <= 50 && y >= 8.1 && y <= 15)
{
result = x*330+x*35;
}
else if (x >= 51 && x <= 150 && y >= 8.1 && y <= 15)
{
result = x*300+x*35;
}
else if (x >= 151 && x < 9999 && y >= 8.1 && y <= 15)
{
result = x*280+x*35;
}
else if (x >= 2 && x <= 50 && y >= 15.1 && y < 9999)
{
result = x*360+x*35;
}
else if (x >= 51 && x <= 150 && y >= 15.1 && y < 9999)
{
result = x*320+x*35;
}
else if (x >= 151 && x < 9999 && y >= 15.1 && y < 9999)
{
result = x*300+x*35;
}
//без упаковки товара
else if (x == 1 && y >=0 && y <= 1)
{
result = x*200;
}
else if (x == 1 && y >=1.1 && y <= 4)
{
result = x*215;
}
else if (x == 1 && y >=4.1 && y <= 8)
{
result = x*250;
}
else if (x == 1 && y >=8.1 && y <= 15)
{
result = x*330;
}
else if(x == 1 && y >=15.1 && y <= 9999)
{
result = x*360;
}
return result
}
</script>
и соответственно HTML Layot
<h2>{global:formtitle}</h2>
{error}
<!-- Do not remove this ID, it is used to identify the page so that the pagination script can work correctly -->
<fieldset class="formHorizontal formContainer" id="rsform_7_page_0">
<div class="rsform-block rsform-block-xls">
<div class="formControlLabel">{XLS:caption}</div>
<div class="formControls">
<div class="formBody">{XLS:body}<span class="formValidation">{XLS:validation}</span></div>
<p class="formDescription">{XLS:description}</p>
</div>
</div>
<div class="rsform-block rsform-block-naimenovanie-tovara">
<div class="formControlLabel">{naimenovanie_tovara:caption}</div>
<div class="formControls">
<div class="formBody">{naimenovanie_tovara:body}<span class="formValidation">{naimenovanie_tovara:validation}</span></div>
<p class="formDescription">{naimenovanie_tovara:description}</p>
</div>
</div>
<div class="rsform-block rsform-block-edinica-izmereniya">
<div class="formControlLabel">{edinica_izmereniya:caption}</div>
<div class="formControls">
<div class="formBody">{edinica_izmereniya:body}<span class="formValidation">{edinica_izmereniya:validation}</span></div>
<p class="formDescription">{edinica_izmereniya:description}</p>
</div>
</div>
<div class="rsform-block rsform-block-x">
<div class="formControlLabel">{x:caption}</div>
<div class="formControls">
<div class="formBody">{x:body}<span class="formValidation">{x:validation}</span></div>
<p class="formDescription">{x:description}</p>
</div>
</div>
<div class="rsform-block rsform-block-y">
<div class="formControlLabel">{y:caption}</div>
<div class="formControls">
<div class="formBody">{y:body}<span class="formValidation">{y:validation}</span></div>
<p class="formDescription">{y:description}</p>
</div>
</div>
<div class="rsform-block rsform-block-razmer">
<div class="formControlLabel">{razmer:caption}</div>
<div class="formControls">
<div class="formBody">{razmer:body}<span class="formValidation">{razmer:validation}</span></div>
<p class="formDescription">{razmer:description}</p>
</div>
</div>
<div class="rsform-block rsform-block-otkyda">
<div class="formControlLabel">{otkyda:caption}</div>
<div class="formControls">
<div class="formBody">{otkyda:body}<span class="formValidation">{otkyda:validation}</span></div>
<p class="formDescription">{otkyda:description}</p>
</div>
</div>
<div class="rsform-block rsform-block-kyda">
<div class="formControlLabel">{kyda:caption}</div>
<div class="formControls">
<div class="formBody">{kyda:body}<span class="formValidation">{kyda:validation}</span></div>
<p class="formDescription">{kyda:description}</p>
</div>
</div>
<div class="rsform-block rsform-block-name-polychatelya">
<div class="formControlLabel">{name_polychatelya:caption}</div>
<div class="formControls">
<div class="formBody">{name_polychatelya:body}<span class="formValidation">{name_polychatelya:validation}</span></div>
<p class="formDescription">{name_polychatelya:description}</p>
</div>
</div>
<div class="rsform-block rsform-block-kontakt-polychatelya">
<div class="formControlLabel">{kontakt_polychatelya:caption}</div>
<div class="formControls">
<div class="formBody">{kontakt_polychatelya:body}<span class="formValidation">{kontakt_polychatelya:validation}</span></div>
<p class="formDescription">{kontakt_polychatelya:description}</p>
</div>
</div>
<div class="rsform-block rsform-block-hranenie">
<div class="formControlLabel">{hranenie:caption}</div>
<div class="formControls">
<div class="formBody">{hranenie:body}<span class="formValidation">{hranenie:validation}</span></div>
<p class="formDescription">{hranenie:description}</p>
</div>
</div>
<div class="rsform-block rsform-block-cena">
<div class="formControlLabel">{cena:caption}</div>
<div class="formControls">
<div class="formBody">{cena:body}<span class="formValidation">{cena:validation}</span></div>
<p class="formDescription">{cena:description}</p>
</div>
</div>
<div class="rsform-block rsform-block-proverka">
<div class="formControlLabel">{proverka:caption}</div>
<div class="formControls">
<div class="formBody">{proverka:body}<span class="formValidation">{proverka:validation}</span></div>
<p class="formDescription">{proverka:description}</p>
</div>
</div>
<div class="rsform-block rsform-block-result">
<div class="formControlLabel">{result:caption}</div>
<div class="formControls">
<div class="formBody">{result:body}<span class="formValidation">{result:validation}</span></div>
<p class="formDescription">{result:description}</p>
</div>
</div>
<div class="rsform-block rsform-block-submit">
<div class="formControlLabel">{submit:caption}</div>
<div class="formControls">
<div class="formBody">{submit:body}<span class="formValidation">{submit:validation}</span></div>
<p class="formDescription">{submit:description}</p>
</div>
</div>
</fieldset>
Объясните пожалуйста в чем их коды отличаются от моих, что отказываются работать? (((((
P.S. заранее спасибо всем кто решит мне помочь!