Forum


Calc Builder Support

Calc Builder support
Forums
Public write access is disabled. Please login

Need help formatting inches and feet in textarea 21.03.2014 05:36

Hello, I have a calculator with a description section that is a textarea. In this section, users enter data such as 3'2" x 3"3" . But as you know, special characters like " and ' escape and cause the data to be truncated. I know how to format numbers because of your examples like "$inline1=number_format($inline1,2,".",",");". How then can I format my textarea field to not escape my special characters?

Re: Need help formatting inches and feet in textarea 21.03.2014 10:01

Hello,
in fact single quotes are not affecting to text formatting at textarea, while double quotes do. As a workaround you can automatically replace double quotes for a couple of single ones, so the whole information introduced at the textarea can travel without problems. Assumming your textarea field has the name 'area', you can add this line to the javascript tab 'executed before calculate execution':


CB("textarea[fldname='area']").val(CB("textarea[fldname='area']").val().replace(/\"/g, "''"));


(replace the both 'area' name for your own field name). This should do the work.


Regards
Moonsoft Team
www.moonsoft.es

Re: Need help formatting inches and feet in textarea 21.03.2014 15:29

Took a little while to get working but works like a charm now. Thanks! I had 6 description fields. They were description1, 2, 3, etc. But by adding the JS for just description1, all of the other fields worked as well. Great component and Great support!

Re: Need help formatting inches and feet in textarea 21.03.2014 15:46

Great it worked, thanks for the feedback. Not sure of why it worked for the other fields, in case you need to apply the replace for them, just add more lines changing the fldname property for each one.

Thanks, regards
Moonsoft Team
www.moonsoft.es
Are you satisfied with our products/services/support?
Please help us to keep improving, add a review at  joomla extensions site and  magento connect

Our clients' feedback