Hello, Guest |
| Register
Remember me Forgot password ?
Site Map Site Map Contact us Contact us
PrestaShop e-commerce software
  430 users online
Forum  >  English Forum  >  General discussion  >  Thread

 
Post Reply
New Topic
Javascript into product description

offline
Posted: 21 January 2010 01:33 PM   [ Ignore ]
Beginner
Rank

Messages :

  • total: 9
  • last 7 days: 0
Joined: 2009-10-08

Hello,

If I try to call a JavaScript function into the HTML of a product description, i get error:

the field description (English (English)) is invalid

How can I solve this?

Thank you.

 
offline
Posted: 22 January 2010 06:33 AM   [ Ignore ]   [ # 1 ]
Moderator
RankRankRankRankRank
Avatar

Messages :

  • total: 6005
  • last 7 days: 163
Joined: 2008-10-16

Javascript is disabled by default in TinyMCE for security reasons. If you are the only person who can edit content using the Back Office and know what you are doing, go to js/tinymce/jscripts/tiny_mce/tiny_mce.js, look for the “valid_elements” section and add script[language|type|src] to end like this to enable javascript.

valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big,script[language|type|src]"

 Signature 

Check out Nethercott Constructions for Prestashop modules and programming for hire.  Now on Facebook.

All free and paid software, modules, themes and modifications are subject to the terms and conditions here.

 
offline
Posted: 15 February 2010 12:37 PM   [ Ignore ]   [ # 2 ]
Beginner
Rank

Messages :

  • total: 15
  • last 7 days: 0
Joined: 2010-02-14

Hi Rocky, I try to find this your code, but, i have 1.2.5 prestashop version, your code is the same? all it’s ok until

“script[language|type|src]”

I dont have this…

I’m trying to install a video gallery, but i cant…

 
offline
Posted: 15 February 2010 01:44 PM   [ Ignore ]   [ # 3 ]
Moderator
RankRankRankRankRank
Avatar

Messages :

  • total: 6005
  • last 7 days: 163
Joined: 2008-10-16

@jselva

It normal for you to be missing that code. You are supposed to add it on the end so that TinyMCE doesn’t remove <script> tags.

 Signature 

Check out Nethercott Constructions for Prestashop modules and programming for hire.  Now on Facebook.

All free and paid software, modules, themes and modifications are subject to the terms and conditions here.

 
offline
Posted: 15 February 2010 02:02 PM   [ Ignore ]   [ # 4 ]
Beginner
Rank

Messages :

  • total: 15
  • last 7 days: 0
Joined: 2010-02-14

Thanks Rocky, but i cant…

Appeare the same error,I attach my “tiny_mce.js”

My shop is in Spanish, there isn’t a problem, no?

Thanks again.

File Attachments
tiny_mce.js  (File Size: 163KB - Downloads: 61)
 
offline
Posted: 15 February 2010 02:08 PM   [ Ignore ]   [ # 5 ]
Beginner
Rank

Messages :

  • total: 15
  • last 7 days: 0
Joined: 2010-02-14

Rocky, your module carrousel it’s fantastic, but, when I download it from your website, download without the extension “.rar” wink

 
offline
Posted: 16 February 2010 03:41 AM   [ Ignore ]   [ # 6 ]
Moderator
RankRankRankRankRank
Avatar

Messages :

  • total: 6005
  • last 7 days: 163
Joined: 2008-10-16

You’ve got your valid_elements set to * [ * ] for some reason. You can try replacing it with the above code, but if your existing code means that all elements are accepted, then your problem isn’t caused by TinyMCE filtering the script. There must be another problem preventing the module from working.

The extension should actually be .zip. This is a bug in Prestashop v1.2.5. I’ll have to check whether it has been fixed in Prestashop v1.3 alpha 1. I’ll report it to the bug tracker if it still doesn’t work.

 Signature 

Check out Nethercott Constructions for Prestashop modules and programming for hire.  Now on Facebook.

All free and paid software, modules, themes and modifications are subject to the terms and conditions here.

 
offline
Posted: 16 February 2010 07:39 AM   [ Ignore ]   [ # 7 ]
V.I.P.
RankRankRankRank
Avatar

Messages :

  • total: 656
  • last 7 days: 0
Joined: 2009-01-01

jselva - 15 February 2010 02:02 PM
Thanks Rocky, but i cant…

Appeare the same error,I attach my “tiny_mce.js”

My shop is in Spanish, there isn’t a problem, no?

Thanks again.

If you know what you are doing. And you feel comfortable with the database. Enter the JS directly into the DB. That is what I did. http://www.blossomcart.com/Other-Bouquets/3025-hydrangeas.html insides the more detail tab…

 Signature 

Blossomcart

Flowers and Gifts Shop

 
offline
Posted: 03 March 2010 05:17 AM   [ Ignore ]   [ # 8 ]
Club Member
RankRankRank
Avatar

Messages :

  • total: 131
  • last 7 days: 2
Joined: 2009-10-31

I still get “the field description (English (English)) is invalid” even though I added “script[language|type|src]”
tinymca will not let me add javascript

 
offline
Posted: 12 March 2010 07:28 AM   [ Ignore ]   [ # 9 ]
Moderator
RankRankRankRankRank
Avatar

Messages :

  • total: 6005
  • last 7 days: 163
Joined: 2008-10-16

Good news everybody! Prestashop v1.3 beta 1 now allows Javascript in the product description. We just have to wait for v1.3 final to be released before using it on a live shop.

 Signature 

Check out Nethercott Constructions for Prestashop modules and programming for hire.  Now on Facebook.

All free and paid software, modules, themes and modifications are subject to the terms and conditions here.

 
offline
Posted: 13 March 2010 02:30 PM   [ Ignore ]   [ # 10 ]
Club Member
RankRankRank
Avatar

Messages :

  • total: 131
  • last 7 days: 2
Joined: 2009-10-31

WOOT!!!! Awesome news!

 
 
 
Fast Reply
New Topic