We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
JavaScript problem; One works the other doesn't.
Topic Started: May 24 2005, 04:34 PM (347 Views)
solinent
Member Avatar
Member
[ *  *  * ]
Ok, well I remade a calculator with ASP, so some of the fields will seem unnessesary, but they are nessesary. However, I'll show you the output of the ASP code, and I really need to know why it's not working(more on this after the code):

Code:
 
<html>
<head>
<title>ApocalypseCalculator</title>
<style type="text/css">
<!--
A.ssmItems:link  {color:white;text-decoration:none;}
A.ssmItems:hover {color:white;text-decoration:none;}
A.ssmItems:active {color:white;text-decoration:none;}
A.ssmItems:visited {color:white;text-decoration:none;}
//-->
</style>

<SCRIPT SRC="/ssm.js" language="JavaScript1.2"></SCRIPT>
<SCRIPT SRC="/ssmItems.js" language="JavaScript1.2"></SCRIPT>
<style>
Table, tr, td, th { border: 1px solid #EE0000;}
#input_box { background-color:#000000; color: white}
#input_box2 { background-color:#000000; color: #EE0000 }
INPUT.box { border: 1px solid black }
INPUT.box2 { border: 1px solid #EE0000 }
</style>
<meta name="description" content="RuneScape Apocalypse is your #1 sourse for runescape skill and quest guides plus chatting forums.">
<meta name="keywords" content="RuneScape, RuneScape cheats, RuneScape guides, RuneScape tips, RuneScape quests, RuneScape skills, RuneScape help, RuneScape forums, RuneScape apocalypse">
<style type="text/css">
a:link {color: #EE4000}
a:visited {color: #EE4000}
a:hover {color: white; text-decoration: underline}
a:active {color: #EE4000}
a {text-decoration: none}

</style>
<script language="javascript">
<!---hide me
function getexp_needed()
{
window.document.simple_form2.Common_Tree.value=parseInt((window.document.simple_form3.get_exp.value-window.document.simple_form.total_exp.value)/25+1);
window.document.simple_form2.Oak_Tree.value=parseInt((window.document.simple_form3.get_exp.value-window.document.simple_form.total_exp.value)/25+1);
window.document.simple_form2.Willow_Tree.value=parseInt((window.document.simple_form3.get_exp.value-window.document.simple_form.total_exp.value)/25+1);
window.document.simple_form2.Maple_Tree.value=parseInt((window.document.simple_form3.get_exp.value-window.document.simple_form.total_exp.value)/25+1);
window.document.simple_form2.Yew_Tree.value=parseInt((window.document.simple_form3.get_exp.value-window.document.simple_form.total_exp.value)/25+1);
window.document.simple_form2.Magic_Tree.value=parseInt((window.document.simple_form3.get_exp.value-window.document.simple_form.total_exp.value)/25+1);

}  
//-->
</script>
</head>
<body text="white" bgcolor="black">
<P></P>
<P></P>
<h2 align="center"><font color="#EE0000">Woodcutting Calculator</font></h2>
<b><p>To use the calculator, enter your experience into the box that says your total exp (to get this, go to runescape, and then hover your mouse over the woodcutting skill, and look to the bottom to find out the total exp).  On the left side of the calculator, you will see a list of levels, click on the level that you would like to get to.  The number of logs that you will have to cut down is just below the place where you enter your exp</b></P>

<!--calculator starts here-->

<table align="center" border="1" bordercolor="#EE0000">
<tr style="background-image: url(/pictures/navstrip2.bmp)" style="height: 30px">
<th><font color="black">What you need to do</font></th>

<th><font color="black">What level you want</font></th>
<tr>
<td valign="top">
<form name="simple_form" method="GET" action="/members/dynamicCalcs/calctemplate.asp">
<p><b>Enter your name:</b><input type="text" name="name" value="Solinent" id="input_box2" class="box2" /><br /><input type="submit" id="input_box2" class="box2" value="Retrieve Exp!" /></p>
<p><b>Your total exp:</b>
<input type="text" size="13" name="total_exp" onChange="getexp_needed()" value="312685" id="input_box2" class="box2"></P>
</form>
<form name="form">

<p><b>You need this much experience: </b>
<input type="text" size="13" name="exp_needed" readOnly="yes" value="0" id="input_box" class="box"></p>
</form>

<form name="simple_form2">
<table border="1" align="center" bordercolor="#EE0000">
<tr style="background-image: url(/pictures/navstrip2.bmp)">
<th><font color="black">Number</font></th>
<th><font color="black">Name</font></th>
<th><font color="black">Lvl.</font></th>
<th><font color="black">Exp.</font></th>
</tr>
<tr><td><input type='text' readOnly name='Common_Tree' size='6' id='input_box2' class='box'></td>
<td>Common Tree</td>
<td>1</td>

<td>25</td></tr>
<tr><td><input type='text' readOnly name='Oak_Tree' size='6' id='input_box2' class='box'></td>
<td>Oak Tree</td>
<td>15</td>
<td>37.5</td></tr>
<tr><td><input type='text' readOnly name='Willow_Tree' size='6' id='input_box2' class='box'></td>
<td>Willow Tree</td>
<td>30</td>
<td>67.5</td></tr>
<tr><td><input type='text' readOnly name='Maple_Tree' size='6' id='input_box2' class='box'></td>

<td>Maple Tree</td>
<td>45</td>
<td>100</td></tr>
<tr><td><input type='text' readOnly name='Yew_Tree' size='6' id='input_box2' class='box'></td>
<td>Yew Tree</td>
<td>60</td>
<td>175</td></tr>
<tr><td><input type='text' readOnly name='Magic_Tree' size='6' id='input_box2' class='box'></td>
<td>Magic Tree</td>
<td>75</td>

<td>250</td></tr>

</table>
</form>
</td>



<td>
<form name="simple_form3">
<select size="25" name="get_exp"  onChange="getexp_needed()" value="0" id="input_box2" class="box2">
<option value="0">Level 1 </option>
<option value="83">Level 2 </option>
<option value="174">Level 3</option>

<option value="276">Level 4</option>
<option value="388">Level 5</option>
<option value="512">Level 6</option>
<option value="650">Level 7</option>
<option value="801">Level 8</option>
<option value="969">Level 9</option>
<option value="1154">Level 10</option>
<option value="1358">Level 11</option>
<option value="1584">Level 12</option>

<option value="1833">Level 13</option>
<option value="2107">Level 14</option>
<option value="2411">Level 15</option>
<option value="2746">Level 16</option>
<option value="3115">Level 17</option>
<option value="3523">Level 18</option>
<option value="3973">Level 19</option>
<option value="4470">Level 20</option>
<option value="5081">Level 21</option>

<option value="5624">Level 22</option>
<option value="6291">Level 23</option>
<option value="7028">Level 24</option>
<option value="7842">Level 25</option>
<option value="8740">Level 26</option>
<option value="9730">Level 27</option>
<option value="10824">Level 28</option>
<option value="12031">Level 29</option>
<option value="13363">Level 30</option>

<option value="14833">Level 31</option>
<option value="16456">Level 32</option>
<option value="18247">Level 33</option>
<option value="20224">Level 34</option>
<option value="22406">Level 35</option>
<option value="24815">Level 36</option>
<option value="27473">Level 37</option>
<option value="30408">Level 38</option>
<option value="33648">Level 39</option>

<option value="37224">Level 40</option>
<option value="41171">Level 41</option>
<option value="45529">Level 42</option>
<option value="50339">Level 43</option>
<option value="55649">Level 44</option>
<option value="61512">Level 45</option>
<option value="67983">Level 46</option>
<option value="75127">Level 47</option>
<option value="83014">Level 48</option>

<option value="91721">Level 49</option>
<option value="101333">Level 50</option>
<option value="111945">Level 51</option>
<option value="123660">Level 52</option>
<option value="136594">Level 53</option>
<option value="150872">Level 54</option>
<option value="166636">Level 55</option>
<option value="184040">Level 56</option>
<option value="203254">Level 57</option>

<option value="224466">Level 58</option>
<option value="247886">Level 59</option>
<option value="273742">Level 60</option>
<option value="302288">Level 61</option>
<option value="333804">Level 62</option>
<option value="368599">Level 63</option>
<option value="407015">Level 64</option>
<option value="449428">Level 65</option>
<option value="496254">Level 66</option>

<option value="547953">Level 67</option>
<option value="605032">Level 68</option>
<option value="668051">Level 69</option>
<option value="737627">Level 70</option>
<option value="814445">Level 71</option>
<option value="899257">Level 72</option>
<option value="992895">Level 73</option>
<option value="1096278">Level 74</option>
<option value="1210421">Level 75</option>

<option value="1336443">Level 76</option>
<option value="1475581">Level 77</option>
<option value="1629200">Level 78</option>
<option value="1798808">Level 79</option>
<option value="1986068">Level 80</option>
<option value="2192818">Level 81</option>
<option value="2421087">Level 82</option>
<option value="2673114">Level 83</option>
<option value="2951373">Level 84</option>

<option value="3258594">Level 85</option>
<option value="3597792">Level 86</option>
<option value="3972294">Level 87</option>
<option value="4385776">Level 88</option>
<option value="4842295">Level 89</option>
<option value="5346332">Level 90</option>
<option value="5902831">Level 91</option>
<option value="6517253">Level 92</option>
<option value="7195629">Level 93</option>

<option value="7944614">Level 94</option>
<option value="8771558">Level 95</option>
<option value="9684577">Level 96</option>
<option value="10692629">Level 97</option>
<option value="11805606">Level 98</option>
<option value="13034431">Level 99</option>
</select>


</td>
</tr>

</body>
</html>

Ok, if you enter in some exp inside the exp box(the name one won't work as I'm not giving you the script to it...But once you enter(say you enter 1) then you click on "Level 2" The calculator should generate a different number beside each item. I have gotten this working before, I just made it ALOT easier on myself and did it in ASP. Can someone fix the problem? Thanks!
Offline Profile Goto Top
 
solinent
Member Avatar
Member
[ *  *  * ]
ok nvm, it was a trivial problem...i allways divided by 25 instead of a variable. It's fixed now :)
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Technology Chat · Next Topic »
Locked Topic