Swap Button image and button text Positions

By | May 16, 2012

One day while doing the design of Summary page for one of the custom entities an unobvious thought came into my mind whether I can swap the positions of Button text and Button image on button control. Also following sage CRM standards I wanted to use the standard AddButton feature only tomake sure all the parameters are getting passed on the next pages. Well  a few lines of Javascript on custom content can do this job very easily for you. Here is the summary.
Actual Output:

Desired output:

Script on Custom content of the screen:
< script for=window event=onload >
var oButtons = document.getElementsByTagName(“A”)
                                var inhtm = new String(oButtons[i].innerHTML)
                                                //’Find image and text html
                                                var ImageHTM = oButtons[i-1].innerHTML
                                                var TextHTM = oButtons[i].innerHTML
                                                oButtons[i-1].innerHTML = TextHTM;
                                                oButtons[i].innerHTML = ImageHTM;
< /script >