hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : how to get numbers from a form text field using BreezingForms in Joomla?
Reply

Forum Jump

how to get numbers from a form text field using BreezingForms in Joomla?

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 06-13-2010, 12:56 PM
SoftDux SoftDux is offline
Web Hosting Master
 
Join Date: Mar 2006
Location: Johannesburg,South Africa
Posts: 598

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(elementmessage)
{
    
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]

__________________
South African Web Hosting - http://www.SoftDux.co.za || SA WebHostingTalk - http://www.webhostingtalk.co.za


Last edited by SoftDux; 06-13-2010 at 01:01 PM.
Reply With Quote


Sponsored Links
  #2  
Old 06-13-2010, 03:15 PM
Karl Karl is offline
Disabled
 
Join Date: May 2009
Location: Hull, UK.
Posts: 911
PHP Code:
$string "1 Apple 2 Oranges";

$new_string ereg_replace("[^0-9]"""$string); 
This would give the output:
12

If that's the kind of thing you're looking for, I haven't however used breezing forms before.

Reply With Quote
  #3  
Old 06-13-2010, 03:32 PM
SoftDux SoftDux is offline
Web Hosting Master
 
Join Date: Mar 2006
Location: Johannesburg,South Africa
Posts: 598
Quote:
Originally Posted by -Karl- View Post
PHP Code:
$string "1 Apple 2 Oranges";

$new_string ereg_replace("[^0-9]"""$string); 
This would give the output:
12

If that's the kind of thing you're looking for, I haven't however used breezing forms before.
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=26

__________________
South African Web Hosting - http://www.SoftDux.co.za || SA WebHostingTalk - http://www.webhostingtalk.co.za

Reply With Quote
Sponsored Links
  #4  
Old 09-10-2010, 04:13 AM
SoftDux SoftDux is offline
Web Hosting Master
 
Join Date: Mar 2006
Location: Johannesburg,South Africa
Posts: 598
Can anyone help me with this?

__________________
South African Web Hosting - http://www.SoftDux.co.za || SA WebHostingTalk - http://www.webhostingtalk.co.za

Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to show / hide elements with Joomla + BreezingForms classic mode? SoftDux Programming Discussion 0 06-13-2010 10:31 AM
Form Field Focus icoso Web Design and Content 2 01-29-2007 11:23 AM
Form Text Field Widths style Problem ePlanetDesign Web Design and Content 3 06-24-2005 10:06 AM
Text with quote marks in a text input field okok Programming Discussion 4 07-31-2004 01:17 PM
Form Field and JavaScript... mkalavitz Web Design and Content 1 03-08-2004 08:17 AM

Related posts from TheWhir.com
Title Type Date Posted
Joomla Adds New Encryption Features, Streamlines Interface with Joomla 3.2 Release Web Hosting News 2013-11-06 15:22:58
Joomla Users Urged to Apply Critical Security Patch to Prevent Malware, Phishing Web Hosting News 2013-08-14 10:21:36
Open Source Content Management System Joomla Surpasses 36 Million Downloads Web Hosting News 2012-11-29 16:38:54
Joomla Hosting Study Shows Speed, Uptime Top Selling Points of a Web Host Web Hosting News 2012-11-07 15:06:36
Open Source Content Management System Joomla Releases Mobile-Friendly Joomla 3.0 with Bootstrap Web Hosting News 2012-09-27 15:40:27


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?