SL wiki server javascript
Hello!
I have a small page+javascript which I want to implement to wiki page. I have elliminated problem with html tags filtering (whitelist.plist) with disabling filtering at all. Now I face another problem. Script is not working. I have read manual which says that I should implement java as a file in template folder, but I don't really get it. Could sb explain. I would appreciate any help!
Script looks like this:
<form>
<input onclick="clickCh(this)" type="checkbox" name="one" value="10"> $10.00<br>
<input onclick="clickCh(this)" type="checkbox" name="two" value="12"> $12.00<br>
<br>
<input id="total" type="text" name="total">
</form>
<script language="JavaScript" type="text/javascript">
var total = document.getElementById("total")
function clickCh(caller){
if(caller.checked){
add(caller)
} else {
subtract(caller)
}
}
function add(caller){ total.value = total.value*1 + caller.value*1}
function subtract(caller){ total.value = total.value*1 - caller.value*1}
</script>
Mac mini, Mac OS X (10.6), Mac OSX Server Snow Leopard