Пробовал так:
function isright(product_id, maximum) {
var ns = +($('input[name=\'' + product_id + '\']').val().replace(/\D/g,''))||0;
if (ns>maximum) ns=maximum;
//if (ns<10) ns=10;
$('input[name=\'' + product_id + '\']').val(ns) }
Так:
function isright(product_id, maximum) {
var ns = +($('input[name=\'' + product_id + '\']').val().replace(/\D/g,''))||0;
var ms = $('input[name=\'' + product_id + '\']').val(maximum);
if (ns>ms) ns=ms;
//if (ns<10) ns=10;
$('input[name=\'' + product_id + '\']').val(ns) }
Так:
function isright(product_id, maximum) {
var ns = +($('input[name=\'' + product_id + '\']').val().replace(/\D/g,''))||0;
if (ns>$('input[name=\'' + product_id + '\']').val(maximum);) ns=$('input[name=\'' + product_id + '\']').val(maximum);;
//if (ns<10) ns=10;
$('input[name=\'' + product_id + '\']').val(ns) }
Не получилось