Chillax86 Posted September 19, 2013 Share Posted September 19, 2013 (edited) Hi this is my first post of many, hope someone can help. The problem is I cannot input either of these methods in to a CMS page without an error. <a href="#" onclick="history.go(-1);return false;">BACK</a> <form><input type="button" value=" <-- BACK " onclick="history.go(-1);return false;" /></form> The error I am getting is: The content field (English (United Kingdom)) is invalid. What I would like to know is why is this error appearing? How can I solve the problem? P.S I don't want a back link on every CMS page. Edited September 29, 2013 by Chillax86 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted September 19, 2013 Share Posted September 19, 2013 go to classes/Validate there is a function: public static function isCleanHtml($html, $allow_iframe = false), change it to: public static function isCleanHtml($html, $allow_iframe = false) { $events = 'onmousedown|onmousemove|onmmouseup|onmouseover|onmouseout|onload|onunload|onfocus|onblur|onchange'; $events .= '|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave|onerror|onselect|onreset|onabort|ondragdrop|onresize|onactivate|onafterprint|onmoveend'; $events .= '|onafterupdate|onbeforeactivate|onbeforecopy|onbeforecut|onbeforedeactivate|onbeforeeditfocus|onbeforepaste|onbeforeprint|onbeforeunload|onbeforeupdate|onmove'; $events .= '|onbounce|oncellchange|oncontextmenu|oncontrolselect|oncopy|oncut|ondataavailable|ondatasetchanged|ondatasetcomplete|ondeactivate|ondrag|ondragend|ondragenter|onmousewheel'; $events .= '|ondragleave|ondragover|ondragstart|ondrop|onerrorupdate|onfilterchange|onfinish|onfocusin|onfocusout|onhashchange|onhelp|oninput|onlosecapture|onmessage|onmouseup|onmovestart'; $events .= '|onoffline|ononline|onpaste|onpropertychange|onreadystatechange|onresizeend|onresizestart|onrowenter|onrowexit|onrowsdelete|onrowsinserted|onscroll|onsearch|onselectionchange'; $events .= '|onselectstart|onstart|onstop'; //if (preg_match('/<[ \t\n]*script/ims', $html) || preg_match('/('.$events.')[ \t\n]*=/ims', $html) || preg_match('/.*script\:/ims', $html)) //return false; //if (!$allow_iframe && preg_match('/<[ \t\n]*(i?frame|form|input|embed|object)/ims', $html)) //return false; return true; } 1 Link to comment Share on other sites More sharing options...
Jiten rash (away) Posted September 21, 2013 Share Posted September 21, 2013 u can add this any where in themes/urthemes/cms <input class="button" type="button" onclick="history.back()" value="Back"></input> 4 Link to comment Share on other sites More sharing options...
vekia Posted September 21, 2013 Share Posted September 21, 2013 well, that's right if you want to add back button to each cms page just add it to the cms.tpl file exactly as Jiten suggested Link to comment Share on other sites More sharing options...
CJH Posted February 25, 2014 Share Posted February 25, 2014 Adding the one line of code to the cms page worked perfectly: button created. Is there a way to add code to also have a hover and active color change? Link to comment Share on other sites More sharing options...
vekia Posted February 26, 2014 Share Posted February 26, 2014 you can do it with css styles <input class="button mybutton" type="button" onclick="history.back()" value="Back"></input> then use css styles like: .mybutton:hover { background:red; color:#FFF; } 1 Link to comment Share on other sites More sharing options...
CJH Posted February 27, 2014 Share Posted February 27, 2014 Many thanks indeed ... Link to comment Share on other sites More sharing options...
Fixfinn Posted March 25, 2014 Share Posted March 25, 2014 Sorry for hijacking this post. Is there away to make a back-button and a next-button on product-page? Link to comment Share on other sites More sharing options...
vekia Posted March 26, 2014 Share Posted March 26, 2014 back button - go to last viewed page before going to product page. but ... next button? where customer should be redirected after clicking on it? Link to comment Share on other sites More sharing options...
marcocavicchioli Posted March 9, 2015 Share Posted March 9, 2015 go to classes/Validate there is a function: public static function isCleanHtml($html, $allow_iframe = false), change it to: public static function isCleanHtml($html, $allow_iframe = false) { $events = 'onmousedown|onmousemove|onmmouseup|onmouseover|onmouseout|onload|onunload|onfocus|onblur|onchange'; $events .= '|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave|onerror|onselect|onreset|onabort|ondragdrop|onresize|onactivate|onafterprint|onmoveend'; $events .= '|onafterupdate|onbeforeactivate|onbeforecopy|onbeforecut|onbeforedeactivate|onbeforeeditfocus|onbeforepaste|onbeforeprint|onbeforeunload|onbeforeupdate|onmove'; $events .= '|onbounce|oncellchange|oncontextmenu|oncontrolselect|oncopy|oncut|ondataavailable|ondatasetchanged|ondatasetcomplete|ondeactivate|ondrag|ondragend|ondragenter|onmousewheel'; $events .= '|ondragleave|ondragover|ondragstart|ondrop|onerrorupdate|onfilterchange|onfinish|onfocusin|onfocusout|onhashchange|onhelp|oninput|onlosecapture|onmessage|onmouseup|onmovestart'; $events .= '|onoffline|ononline|onpaste|onpropertychange|onreadystatechange|onresizeend|onresizestart|onrowenter|onrowexit|onrowsdelete|onrowsinserted|onscroll|onsearch|onselectionchange'; $events .= '|onselectstart|onstart|onstop'; //if (preg_match('/<[ \t\n]*script/ims', $html) || preg_match('/('.$events.')[ \t\n]*=/ims', $html) || preg_match('/.*script\:/ims', $html)) //return false; //if (!$allow_iframe && preg_match('/<[ \t\n]*(i?frame|form|input|embed|object)/ims', $html)) //return false; return true; } On PS 1.6.0.14 I edited this file (classes/Validate.php), and I edited also js/admin.js and js/tools.js, but I can't use onclick in html on CMS pages... If I insert correctly "onclick" on an A tag PS remove it. Do I have to edit some other files? (I also disabled HTMLPurifier...) Link to comment Share on other sites More sharing options...
emadshay Posted May 19, 2017 Share Posted May 19, 2017 (edited) Only add Button to CMS content page : <a class="button lnk_view btn btn-default back" title="Back"><span>Back</span></a> then added only 'back' to class. Function for this opration, exist in global.js / theme / YourThemeName / js / global.js line 78 : $(document).on('click', '.back', function(e){ e.preventDefault(); history.back(); }); Enjoy Edited May 19, 2017 by emadshay (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now