sada

Javascript code posted
created at 28 Sep 22:14, updated at 06 Oct 15:00

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function change_quantity(item_id, submit_id, op='+')
{
    var d=document;
    var item=d.getElementById(item_id);
    var v = parseInt(item.value);
    v = isNaN(v) ? 0 : v;
    if (op == '+') {
  v++;
    } else {
  v--;
  if (v <= 0) {
      v = 0
  }
    }
    item.value = v;
    submit=d.getElementById(submit_id);
    submit.click()
}
355 Bytes in 2 ms with coderay