Can anyone help at all?
You see, the code I am about to past works brilliantly in a normaal html page, it adds the calculation down the bottom, but it doesnt work in joomla article with this cool plugin,
anyhelp would be appreciated
thanks
<script type="text/javascript">
calculate = function(totalElement)
{
if (totalElement)
{
var calculation = '';
var overall = '';
var fields = new Array();
var theElement = document.getElementById(totalElement);
var userInputs = myform.elements;
var the_type = '';
for (var f = 0; f < userInputs.length; f++)
{
if (userInputs[f].className=='special_value')
{
if (userInputs[f].type=='select-one')
{
if(userInputs[f].options[userInputs[f].selectedIndex].value)
{
fields[f] = userInputs[f].options[userInputs[f].selectedIndex].value;
}
else
{
fields[f] = 0;
}
}
else if(userInputs[f].type=='radio' || userInputs[f].type=='checkbox')
{
if (userInputs[f].checked)
{
fields[f] = userInputs[f].value;
}
else
{
fields[f] = 0;
}
}
else
{
if (userInputs[f].value)
{
fields[f] = userInputs[f].value;
}
else
{
fields[f] = 0;
}
}
}
}
for (var i=0; i<fields.length; i++)
{
calculation += fields[i];
if (i!=fields.length-1)
{
calculation += '+';
}
}
if (calculation!='')
{
overall = eval(calculation).toFixed(2);
}
if (overall!='')
{
theElement.innerHTML = '£'+overall;
}
}
}
</script>
<h1>Javacsript Forum Calculator</h1>
<p>
Enter some numbers, click some checkboxes and radio buttons and watch the value change (bottom of the page).
</p>
<form name="myform">
<h2>Radio Button</h2>
<input onclick="calculate('total');" name="price111" value="100" class="special_value" type="radio">100<br>
<input onclick="calculate('total');" name="price111" value="200" class="special_value" type="radio">200<br>
<input onclick="calculate('total');" name="price111" value="300" class="special_value" type="radio">300<br>
<input onclick="calculate('total');" name="price111" value="400" class="special_value" type="radio">400<br><br>
<h2>Checkboxes</h2>
<input onclick="calculate('total');" name="price112" value="400" class="special_value" type="checkbox">400<br>
<input onclick="calculate('total');" name="price112" value="600" class="special_value" type="checkbox">600<br>
<input onclick="calculate('total');" name="price112" value="700" class="special_value" type="checkbox">700<br>
<input onclick="calculate('total');" name="price112" value="900" class="special_value" type="checkbox">900<br><br>
<h2>Drop Down Menu</h2>
<select onchange="calculate('total');" name="price5" class="special_value">
<option value="0"></option>
<option value="900">9k</option>
<option value="500">5k</option>
<option value="400">4k</option>
</select>
<br><br><br>
<div id="total"></div>
<input onclick="calculate('total');" name="button" value="re-calculate" type="button">
</form>