SilverNodashi
Expert Member
Does anyone know, or use BreezingForms, on Joomla?
How do I get only numbers from a text field? i.e. a user types in R40, how do I only get the "40" part of it?
I tried the following, but it just gives me "NaN" as response:
A few google searches suggest that the "Number()" function could do this, but it doesn't seem to work. I'm using Joomla 1.5.15 + BreezingForms 1.7.1 Stable (build 730) [Trinity]
How do I get only numbers from a text field? i.e. a user types in R40, how do I only get the "40" part of it?
I tried the following, but it just gives me "NaN" as response:
PHP:
function ff_Total12_validation(element, message)
{
ff_wendy_calculate12();
if (element.value==0) {
ff_validationFocus('Price12');
return message;
} // if
return '';
} // ff_Total12_validation
function ff_wendy_calculate12()
{
var amount12 = 0;
var order12;
var price12;
qty12 = Number(ff_getElementByName('QTY12').value);
price12 = Number(ff_getElementByName('Price12').value);
if (qty12 != '') amount12 += parseInt(qty12) * Number(parseInt(price12));
ff_getElementByName('Total12').value = Math.round(amount12*100)/100;
ff_OrderTotalAmount_validation();
} // ff_wendy_calculate12
A few google searches suggest that the "Number()" function could do this, but it doesn't seem to work. I'm using Joomla 1.5.15 + BreezingForms 1.7.1 Stable (build 730) [Trinity]
Last edited: