marksull Posted January 16, 2010 Share Posted January 16, 2010 Prestrashop 1.2.5On both my hosted service and development host I have an issue where the DESCRIPTION field will fail validation if the Link has OnClick enabled. For example, if I add some text to the DESCRIPTION, select a small portion of it, click on the link button, add in the URL, switch to the events tab, and for the onclick field add some javascript (e.g. return false;) you'll end up with code like this: (note: replace "x" in the following code with "onclick". For some reason this tool automatically removes the onlick attribute from my code example) Test link If you try to save the catalog item, you'll get the error.1 error 1. the field description (English (English)) is invalidIf you amend the link and remove the onclick event, the catalog item will save fine.Bug, or something else? I tried to identify how the validation is being done, but to be honest it was beyond my skill set.CheersMS Link to comment Share on other sites More sharing options...
minh Posted February 1, 2010 Share Posted February 1, 2010 I guess that is because Javascript it disabled by default in TinyMCE. It is apparently a security issue.Look here: http://www.prestashop.com/forums/viewthread/41444/general_discussion/javascript_into_product_description Link to comment Share on other sites More sharing options...
marksull Posted February 2, 2010 Author Share Posted February 2, 2010 Thanks for the suggestion, but this is not the solution. I was trying to use the onclick attribute on a link tag (). Looking at the list of valid_elements in tiny_mce.js I can see "@[...|onclick|...]" already listed, which I interpreted as any tag can have the onclick attribute. I also tried adding a[onclick] to the very beginning of the valid_elements list and again no joy. And yes, I cleared my cache between each test to ensure the js was loaded with the fresh code.I also created a button with an onclick event. Same error. If I removed the onclick attribute from the button and left all other attributes it would work fine.Looks like somewhere the onclick attribute is causing an issue. Scratching my head. Link to comment Share on other sites More sharing options...
Recommended Posts