Current Events > Using javascript to get the minimum out of five numbers inputs

Topic List
Page List: 1
LastTomorrow
12/10/17 3:12:45 PM
#1:


function min() {
var Num1 = Trdform.txtwhole1.value;
var Num2 = Trdform.txtwhole2.value;
var Num3 = Trdform.txtwhole3.value;
var Num4 = Trdform.txtwhole4.value;
var Num5 = Trdform.txtwhole5.value;
Frthform.mininum.value = min;
}

how is this? Or is there something needing change?
---
Waffle waffle waffle
... Copied to Clipboard!
LastTomorrow
12/10/17 3:57:46 PM
#2:


Bump
---
Waffle waffle waffle
... Copied to Clipboard!
LastTomorrow
12/10/17 8:29:33 PM
#3:


bump
---
Waffle waffle waffle
... Copied to Clipboard!
LastTomorrow
12/10/17 8:48:15 PM
#4:


Get in here
---
Waffle waffle waffle
... Copied to Clipboard!
I Like Toast
12/10/17 8:48:32 PM
#5:


Do your own homework
---
If you do things right, people won't be sure you've done anything at all
... Copied to Clipboard!
kirbymuncher
12/10/17 8:50:32 PM
#6:


this doesn't make any sense, there's no comparison or operations done on anything here. all you're doing is setting some variables. there's no way it could ever do anything lol
---
THIS IS WHAT I HATE A BOUT EVREY WEBSITE!! THERES SO MUCH PEOPLE READING AND POSTING STUIPED STUFF
... Copied to Clipboard!
LastTomorrow
12/10/17 8:53:37 PM
#7:


So I used document.getElementById ().innerHTML = Math.min ()?
---
Waffle waffle waffle
... Copied to Clipboard!
Milkman5
12/10/17 8:57:29 PM
#8:


where are you inputting the numbers?
... Copied to Clipboard!
Milkman5
12/10/17 8:59:01 PM
#9:


use

Math.min(n1, n2, n3, ..., nX)

https://www.w3schools.com/jsref/jsref_min.asp
... Copied to Clipboard!
Milkman5
12/10/17 8:59:29 PM
#10:


Can you link me to all your code or something
... Copied to Clipboard!
LastTomorrow
12/10/17 9:11:02 PM
#11:


Milkman5 posted...
use

Math.min(n1, n2, n3, ..., nX)

https://www.w3schools.com/jsref/jsref_min.asp

I know, but can n1 and then be replaced with something else?
---
Waffle waffle waffle
... Copied to Clipboard!
LastTomorrow
12/10/17 9:12:23 PM
#12:


<div id="six">
<form name="Trdform" id="small" method="get">
<input type="text" id="Num1" name="txtwhole1">
<input type="text" id="Num2" name="txtwhole2">
<input type="text" id="Num3" name="txtwhole3">
<input type="text" id="Num4" name="txtwhole4">
<input type="text" id="Num5" name="txtwhole5">
</form>
</div>

<div id="seven">
<form name="Frthform" method="get">
<button>Find Minimum number</button>
<input type="Text" id="min" name="Minimum" onclick="min()">
</form>
</div>
---
Waffle waffle waffle
... Copied to Clipboard!
Sativa_Rose
12/10/17 9:30:56 PM
#13:


LastTomorrow posted...
Milkman5 posted...
use

Math.min(n1, n2, n3, ..., nX)

https://www.w3schools.com/jsref/jsref_min.asp

I know, but can n1 and then be replaced with something else?


Yes, I think you need to learn how functions in programming work if you want to understand this.
---
I may not go down in history, but I will go down on your sister.
... Copied to Clipboard!
Talks
12/10/17 9:32:49 PM
#14:


Have yoou thought about, I dunno, testing it your goddamn self?
---
... Copied to Clipboard!
Life Sympathy
12/10/17 9:35:10 PM
#15:


You're a big boy. Use big boy tools like Stackoverflow

https://stackoverflow.com/a/37787837
---
We're surrounding you. We see you, but you probably don't see us. And if you see us, we're not letting on that we see you.
... Copied to Clipboard!
Topic List
Page List: 1