Hey everyone,
I only had a quick question, sorry about opening a whole new thread for this. Its probably a stupid question, but I am curious to know if there is a simple way to do what I am trying to do.
Okay, so essentially I want the user to input a number in input box 1 and 2 and I want the two boxes to cross reference each other to say if the numbers match or not.
So for example. I put the number '5' in Input Box 1. And I put the number '6' in Input Box 2. In a text area it will display if its a match or not.
I have tried to get it to work and cannot figure out a way to match them. I can get them to add together, display seperately but am puzzled with a way to get them to match. The only way I got it to work was with a realllllllly long if statement and using prompts (which is a little cluttery).
Below is simple code. I dont really need someone to add code, just let me know a method to get the inputs to cross reference each other.
Thanks!
PS Keep in mind that I have very little code. I want to know if this is possibly before I give up my prompt and if statements code to change to this.
Code:
<html>
<head>
<script type="text/javascript">
function one() {
alert(i1.value);
}
</script>
</head>
<body>
<input id="i1" size="1">
<br />
<input id="i2" size="1">
<br />
<button onclick="one()" id="c1" >Calculate</button>
<br />
<textarea name="t1"></textarea>
</body>
</html>