function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jagadeesh AdaveniJagadeesh Adaveni 

Need Error Sound when i am getting error on visualforce page

Hi,

I have Apexpage messages in my controller, when my page message gets fired need some error sound.
How can i do this?
please give me any suggestions

Thanks,
A.Jagadees.
Dario BakDario Bak
jQuery all the way. You should implement jquery in Salesforce first 

1) to use jquery in a VF page, check this: https://developer.salesforce.com/page/Developing_Apps_with_jQuery

2) to play sound with jQuery:

Create a button:
<div id="container">
            <button id="play">
                Play Music
            </button>
</div>

Play the sound on click:
 
$('document').ready(function () {
    $('#play').click(function () {
        var audio = {};
        audio["walk"] = new Audio();
        audio["walk"].src = "http://www.rangde.org/static/bell-ring-01.mp3"
        audio["walk"].addEventListener('load', function () {
            audio["walk"].play();
        });
    });
});

If this works, please choose this comment as best answer!

Regards,
Bhaswanthnaga vivek vutukuriBhaswanthnaga vivek vutukuri
Hope this helps:
 
<apex:page >
<apex:form >
 <audio id="audio" src="http://www.soundjay.com/button/beep-07.wav" autostart="false" ></audio>
   <apex:pagemessages>
<apex:actionsupport event = 'onchange' onsubmit = 'PlaySound()' />

</apex:pagemessages>
​    <script>
    function PlaySound() {
          var sound = document.getElementById("audio");
          sound.play()
      }
    </script>
    </apex:form>
</apex:page>