I have a field where you can insert a number and I want to pass this number as a parameter to a button which calls a function. I tried the getElementById
but didn't work as expected.
My code is called inside php. I get the first 2 parameters(name, price) from a database and I want the third(quantity) one to be from that input. Is it possible?
<input type="number" min="0" style ="width:4em" id="quantity" name="quantity" />
<input type="button" value="Add to Cart" onclick="AddtoCart(\''.$name.'\',\''.$price.'\',quantity); " />