", "answerCount": 3, "upvoteCount": 0, "datePublished": "2013-10-08T08:58:28.000Z", "author": { "@type": "Person", "name": "Padraig Corcoran", "url": "https://trailblazers.salesforce.com/profileView?u=00530000009awDdAAI", "affiliation": { "@type": "Organization", "name": "--" } }, "acceptedAnswer": { "@type": "Answer", "text": "Hi ,   Try this  Object detail page--->create new button(Open new page)--->on this page choose java script at \"Content Source\"--   >   Under formulae write   alert(\" blah blah balh balh bahl blah blah blha blha blhab \");", "upvoteCount": 1, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A8IQpSAN", "datePublished": "2013-10-08T09:09:25.000Z", "author": { "@type": "Person", "name": "Sindoora Gopagoni", "url": "https://trailblazers.salesforce.com/profileView?u=00530000009bWVTAA2", "affiliation": { "@type": "Organization", "name": "Hexagon" } } }, "suggestedAnswer": [ { "@type": "Answer", "text": "well that worked - thank you    instead of an alert box is there away I could have it pop out like a new \"help text\" window?", "upvoteCount": 0, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A8IQpSAN", "datePublished": "2013-10-08T09:55:55.000Z", "author": { "@type": "Person", "name": "Padraig Corcoran", "url": "https://trailblazers.salesforce.com/profileView?u=00530000009awDdAAI", "affiliation": { "@type": "Organization", "name": "--" } } } ] } }
Skip to main content
A simple question I am sure but this is my first bit of coding and I cant get it working. How can I create a Simple Javascript button in Salesforce that when clicked will display a pop out window showing a set text for the user to use? 

 

I have been messing around with the below code but it shows in an aleert box formart which is not exactly what I would like? Any ideas would be appreciated. Thanks

 

<html>

 

<head>

 

<script>

 

function myFunction()

 

{

 

alert(" blah blah balh balh bahl blah blah blha blha blhab ");

 

}

 

</script>

 

</head>

 

<body>

 

<input type="button" onclick="myFunction()" value="Show alert box" />

 

</body>

 

</html>
3 answers
  1. Oct 8, 2013, 9:09 AM
    Hi ,

     

    Try this  Object detail page--->create new button(Open new page)--->on this page choose java script at "Content Source"--

     

    >Hi , Try this Object detail page--->create new button(Open new page)--->on this page choose java script at Under formulae write alert(" blah blah balh balh bahl blah blah blha blh" style="display: block;" />

     

    Under formulae write   alert(" blah blah balh balh bahl blah blah blha blha blhab ");
0/9000