Jump to content

Capitalize Uppercase Product Title using JavaScript


Recommended Posts

How to do so?

The point is the title to be always capitalized (with upper first letter of every word), even when the input is different. If the text is lowercase, it can be done with only css, but when the text is uppercase, it has to be first lowered. You need both script and css. I'm still not really familiar with Prestashop design development, so please give me any hint how to make this code working on category view page for example.

I've linked the new .js file in category controller, so it's now appearing in the code of category view pages, but I cannot force the change. Maybe I'm lacking javascript skills too.

 

I've tried:

$(document).ready(function()

{

document.getElementsByTagName("h3").value.toLowerCase();

});

 

But then the left categories' navigation disappears and it's still not working. Perhaps because I close the function used somewhere else too.

 

Any help will be appreciated.

Link to comment
Share on other sites

I tried to explain it in my first post. You cannot capitalize all CAPS text. It doesn't effect it at all. So I have to first make the whole text lowercase and then capitalize. It can be done only with scripts - PHP or JavaScript. It's not that much important, but it's a matter of visual readability and design. I want to be sure that whoever writes the inputs, the text will be shown in the same way.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...