andyd34 Posted September 22, 2009 Share Posted September 22, 2009 I am using the following to format text within an iframe/text area function formatText(iframe, command, option) { iframe.contentWindow.focus(); try { iframe.focus(); iframe.document.execCommand(command, false, option); iframe.focus(); } catch (e) { } } most things work fine when called $('.bold', tb).click(function(){ formatText(iframe, 'bold');return false; }); $('.italic', tb).click(function(){ formatText(iframe, 'italic');return false; }); $('.underline', tb).click(function(){ formatText(iframe, 'underline');return false; }); $('.$class_name', tb).click(function(){ formatText(iframe, 'InsertImage', '$url/$image'); except "$('.color_$key', tb).click(function(){ formatText(iframe, 'ForeColor', '#666'); Does anyone have any suggestions Quote Link to comment Share on other sites More sharing options...
andyd34 Posted September 24, 2009 Author Share Posted September 24, 2009 Sorted now, just added return false to the string "$('.color_$key', tb).click(function(){ formatText(iframe, 'ForeColor', '#666'); return false; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.