I was hoping a friendly soul could help me out with my javascript problem here.
I am trying to learn a bit about javascript, and coding in general, doing this I am trying to make my own in house auction system, and to do this I do not want people to be able to make a bid on a product which are the same or below, so to do this I want to disable the submit button and so on.
My issue is that I started out working with ID's and learned that if I have multiple elements with the same ID this will not work, so I started working with class instead.
I made the the follow which does not seem to work for some reason, it will not compare the two numbers :(
var inputOne = document.getElementsByClassName('form-control new_bid');
var inputTwo = document.getElementsByClassName('form-control old_bid');
setInterval(function() {
if (inputOne >= inputTwo)
$(":submit").removeAttr("disabled");
else
$(":submit").attr("disabled", "disabled");
}, 1);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="text" class='form-control old_bid' id="current_bid" name="current_bid" readonly>
<input type='text' class='form-control new_bid' id='place_bid' name='place_bid' placeholder='The bid you make are in ".getUser(false)->getOffice()->getRegion()->getCurrency()."' pattern='^[0-9]*$'>
<input id="submit_bid" type="submit" name="submit_bid" class="btn btn-primary" value="Place bid" />
Thanks in advance!