Ok, need some help with Javascript

General debate and discussion. (OOC)
Post Reply
Siesatia
ESUS Testicle Monster
Posts: 1155
Joined: Fri Sep 17, 2004 3:33 am
Prefix: The Unified Worlds of
Name: Siesatia

Ok, need some help with Javascript

Post by Siesatia »

I'm trying to make a roll-code for a ZF Board I'm working on getting online, would anyone who's good with JS be able to help with a code?

[code]<script type="text/javascript">
$("td:contains('Display emoticons in your post')").append("<br /><input type='checkbox' onclick='Dice_Is(this.checked)'> Enable Dice Roll?");

function Dice_Is(really){
if(really==true){
document.forms['posting'].onsubmit=function(){
document.forms['posting'].post.value+="\n\n\nYou rolled a: [b]"+Math.floor(Math.random()*20+1)+"[/b]!";
}
}
}
</script>
[/code]

I need to make this so that whenever it lands on 10's or 20's, it rolls again, and adds the results.
Dear god... No more 5 year old Signature...

Proud ESUS Member since '04
Post Reply