I know this is fairly simple, I haven’t been coding for awile and my mind won’t get around this.
I have a page where you can click “+” or “-” to edit the number in the input box. I need to show the total change of the number next to the box. For instance if the box has four and you click “+” then the box has 5 and a 1 next to it. I can’t put the 1 in an input box because it causes form problems with my script. I need to write the total adjustment number on the page.
Here is what I’m working with.
[code=php]function qty(obj, i)
{
obj = document.getElementById(obj);
if(typeof obj == ‘object’)
obj.value = parseInt(obj.value) + i;
obj.className == null;
obj.className == ‘hidemered’;
}
<input type=”button” name=”Submit” value=” + ” onclick=”qty(‘product1’, 1)”>
<input type=”button” name=”Submit” value=” – ” onclick=”qty(‘product1’, -1)”>
After that I need to write the total adjusted number. I tried a few things in the function qty, but I’m too rusty at it. Thanks for any help!