crubbles
12-31-2002, 02:37 AM
This is a script I made. Only problem is, that when the page loads..the script executes. I want to associate the execution of my script with the onClick of the button.
If my script needs to be totally revamped because I started off totally wrong...please don't tell me that. Instead call me an idiot and tell me to give up trying to program altogether. Thanks. :)
<p>
<form name=solve>
<input type="button" value="Fix my problem" onClick="solve()">
<SCRIPT LANGUAGE="JavaScript">
var solve;
var solvey;
var solveyy;
var solveyn;
var solveyyy;
var solveyny;
var solveynyy;
solve = prompt("Has something gone wrong?", "Type yes or no");
if(solve =='no') {
alert('Then DONT mess with it!!');
alert('Problem Solved!');
// *************************************************
// this is as far as anyone willing to help needs to see --I think :P
}
if(solve == 'yes') {
solvey = prompt("Was it your fault?",'');
if(solvey == 'yes') {
alert("You fool!");
solveyy = prompt("Does anyone know?",'');
if(solveyy == 'yes') {
alert("You got it tuff..");
solveyyy = prompt("Can you blame someone else?",'');
if(solveyyy == 'yes') {
alert("Do so quickly");
alert("Problem Solved!");
}
else {
alert("You got it bad... stiff it out!");
alert("Problem Solved!");
}
}
else {
alert("Hide it!");
alert("Problem Solved");
}
}
else {
solveyny = prompt("Will you get in trouble anyway?",'');
if (solveyny == 'yes') {
solveabaa= prompt("Can you blame someone else?",'');
if(solveynyy == 'yes') {
alert("Problem Solved!");
}
else {
alert("You're in deep...stiff it out!");
alert("Problem Solved!");
}
}
else {
alert("Make sure there are no witnesses!!");
alert("Problem Solved!");
}
}
}
// I saw a sort of flowsheet drawing of this on the internet
// And wanted to see if I could duplicate it in JavaScript
// It's pretty funny; you can use it on your own site, as long
// as you don't claim you built it.
// Do not steal without permission!!
// I know its written very sloppy, so if you improve on it...please
// email crubbles@hotmail.com with the source. Thanks.
</SCRIPT>
</form>
If my script needs to be totally revamped because I started off totally wrong...please don't tell me that. Instead call me an idiot and tell me to give up trying to program altogether. Thanks. :)
<p>
<form name=solve>
<input type="button" value="Fix my problem" onClick="solve()">
<SCRIPT LANGUAGE="JavaScript">
var solve;
var solvey;
var solveyy;
var solveyn;
var solveyyy;
var solveyny;
var solveynyy;
solve = prompt("Has something gone wrong?", "Type yes or no");
if(solve =='no') {
alert('Then DONT mess with it!!');
alert('Problem Solved!');
// *************************************************
// this is as far as anyone willing to help needs to see --I think :P
}
if(solve == 'yes') {
solvey = prompt("Was it your fault?",'');
if(solvey == 'yes') {
alert("You fool!");
solveyy = prompt("Does anyone know?",'');
if(solveyy == 'yes') {
alert("You got it tuff..");
solveyyy = prompt("Can you blame someone else?",'');
if(solveyyy == 'yes') {
alert("Do so quickly");
alert("Problem Solved!");
}
else {
alert("You got it bad... stiff it out!");
alert("Problem Solved!");
}
}
else {
alert("Hide it!");
alert("Problem Solved");
}
}
else {
solveyny = prompt("Will you get in trouble anyway?",'');
if (solveyny == 'yes') {
solveabaa= prompt("Can you blame someone else?",'');
if(solveynyy == 'yes') {
alert("Problem Solved!");
}
else {
alert("You're in deep...stiff it out!");
alert("Problem Solved!");
}
}
else {
alert("Make sure there are no witnesses!!");
alert("Problem Solved!");
}
}
}
// I saw a sort of flowsheet drawing of this on the internet
// And wanted to see if I could duplicate it in JavaScript
// It's pretty funny; you can use it on your own site, as long
// as you don't claim you built it.
// Do not steal without permission!!
// I know its written very sloppy, so if you improve on it...please
// email crubbles@hotmail.com with the source. Thanks.
</SCRIPT>
</form>