186
rated 0 times
[
187]
[
1]
/ answers: 1 / hits: 16782
/ 13 Years ago, mon, december 26, 2011, 12:00:00
pretty simple issue here, this was working before but not anymore.
heres my code:
$('.filter-price').submit(function(e) {
var alert_message = '';
var price_from = $('.filter-price #price_from').val();
var price_to = $('.filter-price #price_to').val();
if (isNaN(price_from) || isNaN(price_to))
{
if (isNaN(price_from))
{
alert_message += Price from must be a number, i.e. 500n;
$('.filter-price #price_from').val('From');
}
if (isNaN(price_to))
{
alert_message += Price to must be a number, i.e. 500n;
$('.filter-price #price_to').val('To');
}
}
else
{
price_from = price_from.toFixed();
price_to = price_to.toFixed();
if (price_from >= price_to)
{
alert_message += Price from must be less than price ton;
$('.filter-price #price_from').val('From');
$('.filter-price #price_to').val('To');
}
}
if (alert_message != '')
{
e.preventDefault();
alert(alert_message);
}
});
now web developer is giving me the error price_from.toFixed is not a function and my javascript is not working.
More From » jquery