Results 1 to 4 of 4
-
06-13-2010, 12:56 PM #1Web Hosting Master
- Join Date
- Mar 2006
- Location
- Johannesburg,South Africa
- Posts
- 601
how to get numbers from a form text field using BreezingForms in Joomla?
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:
PHP Code: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
Last edited by SoftDux; 06-13-2010 at 01:01 PM.
South African Web Hosting - http://www.SoftDux.co.za || SA WebHostingTalk - http://www.webhostingtalk.co.za
-
06-13-2010, 03:15 PM #2Disabled
- Join Date
- May 2009
- Location
- Hull, UK.
- Posts
- 911
PHP Code:$string = "1 Apple 2 Oranges";
$new_string = ereg_replace("[^0-9]", "", $string);
12
If that's the kind of thing you're looking for, I haven't however used breezing forms before.
-
06-13-2010, 03:32 PM #3Web Hosting Master
- Join Date
- Mar 2006
- Location
- Johannesburg,South Africa
- Posts
- 601
Yes, I'm looking for something similar to ereg_replace, but that will work with BreezingForms.
The code structure that BreezingForms uses seems like it could be JavaScript, but my JS knowledge isn't very good so I can't say. Look at the code here and you'll see what I mean: http://www.crosstec.de/support/index...ntclient&id=26South African Web Hosting - http://www.SoftDux.co.za || SA WebHostingTalk - http://www.webhostingtalk.co.za
-
09-10-2010, 04:13 AM #4Web Hosting Master
- Join Date
- Mar 2006
- Location
- Johannesburg,South Africa
- Posts
- 601
Can anyone help me with this?
South African Web Hosting - http://www.SoftDux.co.za || SA WebHostingTalk - http://www.webhostingtalk.co.za
Similar Threads
-
how to show / hide elements with Joomla + BreezingForms classic mode?
By SoftDux in forum Programming DiscussionReplies: 0Last Post: 06-13-2010, 10:31 AM -
Form Field Focus
By icoso in forum Web Design and ContentReplies: 2Last Post: 01-29-2007, 11:23 AM -
Form Text Field Widths style Problem
By ePlanetDesign in forum Web Design and ContentReplies: 3Last Post: 06-24-2005, 10:06 AM -
Text with quote marks in a text input field
By okok in forum Programming DiscussionReplies: 4Last Post: 07-31-2004, 01:17 PM -
Form Field and JavaScript...
By mkalavitz in forum Web Design and ContentReplies: 1Last Post: 03-08-2004, 08:17 AM