Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Changing Text To Uppercase Etc Rate Topic   - - - - -

 
  • BarryH
  • Senior Member
  • Members
  • Join Date: 03-Sep 07
  • 1459 posts

Posted 09 December 2016 - 03:52 PM #1

Hi All

 

I was wondering is there a way to convert the text input by the customer to a form that is more suitable?

 

eg..........

 

Customer inputs shipping addres as...

 

111 the made up road

somewhere

in a county

aa112bb

 

I want it convert (for Shipping note) to.....

 

111 The Made Up Road

Somwhere

In A County

AA11 2BB

 

or.....

 

111THE MADE UP ROAD

SOMEWHERE

IN A COUNTY

AA11 2BB

 

If that makes sense, because it's a pain when we have to copy and paste shipping note so that wee can alter it.

 

Thanks in advance

 

Barry


BarryH

 

CS-Cart v4.4.3 (Plus one being developed v4.5.2 SP2)
UK User


 
  • oleg.gorshkov
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3010 posts

Posted 09 December 2016 - 05:54 PM #2

Hi All

 

I was wondering is there a way to convert the text input by the customer to a form that is more suitable?

 

eg..........

 

Customer inputs shipping addres as...

 

111 the made up road

somewhere

in a county

aa112bb

 

I want it convert (for Shipping note) to.....

 

111 The Made Up Road

Somwhere

In A County

AA11 2BB

 

or.....

 

111THE MADE UP ROAD

SOMEWHERE

IN A COUNTY

AA11 2BB

 

If that makes sense, because it's a pain when we have to copy and paste shipping note so that wee can alter it.

 

Thanks in advance

 

Barry

 

Hello, Barry!

 

You can use the strtoupper function.


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Mega SEO Package - All you need for your SEO


 
  • BarryH
  • Senior Member
  • Members
  • Join Date: 03-Sep 07
  • 1459 posts

Posted 09 December 2016 - 06:01 PM #3

Thank you.

 

Not sure how to do it but I'll try.

 

Thanks again

 

Barry


BarryH

 

CS-Cart v4.4.3 (Plus one being developed v4.5.2 SP2)
UK User


 
  • oleg.gorshkov
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3010 posts

Posted 09 December 2016 - 06:13 PM #4

Thank you.

 

Not sure how to do it but I'll try.

 

Thanks again

 

Barry

 

You can read more about it here


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Mega SEO Package - All you need for your SEO


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10908 posts

Posted 09 December 2016 - 06:24 PM #5

I think he mean you would use strtoupper for the postal code and ucwords for the other fields where you just want title-case.

You can also do this via CSS using the various text-translate functions.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • BarryH
  • Senior Member
  • Members
  • Join Date: 03-Sep 07
  • 1459 posts

Posted 09 December 2016 - 06:52 PM #6

Hi

 

Thank you both.

 

i have done it with....text-transform: none|capitalize|uppercase|lowercase|initial|inherit;

 

Working fine

 

thanks again

 

Barry


BarryH

 

CS-Cart v4.4.3 (Plus one being developed v4.5.2 SP2)
UK User


 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 966 posts

Posted 28 February 2018 - 10:01 PM #7

Very interesting, was just searching for this but.. have the OPPOSITE problem. It seems the form automatically makes everything an upper case when it is the first character.. but this also happens with email addresses which are always lower case! 
 

I thought to have seen a function where you tell to automatically create capitals, but apparently that also makes capitals out of the first character of an email address?

 

TIA, 

Yvana


CS Cart Evangelist - running CS Cart 4.7.4 in three domains


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10908 posts

Posted 28 February 2018 - 10:18 PM #8

It is usually css that controls what case a field is forced to (if any).  Most fields in cs-cart do not have any transforms done on the case of the input text.  So possibly it was added to your site or an addon has provided css that is reaching beyond the intended scope.  The php function to make a string "title case" is ucwords() and to make a string all upper is strtoupper() and to lower is strtolower().  But most likely, you have css that is transforming the input text.  Suggest you "inspect" the code with your browser inspector and see what css is associated with that input field.  If you see something like: "text-transform: uppercase" (or lowercase or capitialize) then you'll want to dig down and find the source of the css.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.