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
sathishsfdcsathishsfdc 

vfpage html placeholer working fine in ie11 but not in ie9 on page refresh

<html>
<body>

<p>A function is triggered when the user is pressing a key in the input field.</p>

<input type="text" onkeypress="myFunction()" placeholder="test" >

<script>
function myFunction() {
    alert("You pressed a key inside the input field");
}
</script>

</body>
</html>

When the panel is getting refreshed the placeholder value is not being displayed.on a portal login

THis issue is only in IE9 but works fine in IE11,Chrome,Mozilla.

Basically the placeholder is not working properly.
Any thoughts on this would be helpful

Thanks
sathish

T
Best Answer chosen by sathishsfdc
sathishsfdcsathishsfdc
http://stackoverflow.com/questions/15020826/how-to-support-placeholder-attribute-in-ie8-and-9

i tried the jquery mentioned in this post and it is working...
thanks

All Answers

Sunil MadanaSunil Madana
hi Sathish, Please use the below code.
<apex:page>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
	<script src="//mathiasbynens.github.io/jquery-placeholder/jquery.placeholder.js"></script>
    <html>
        <body>            
            <p>A function is triggered when the user is pressing a key in the input field.</p>            
            <input type="text" onkeypress="myFunction()" placeholder="test" />
            <script>
                function myFunction() { alert("You pressed a key inside the input field"); }
                $(function() {
                    // Invoke the plugin
                    $('input, textarea').placeholder({customClass:'my-placeholder'});
                });
            </script>
        </body>
    </html>
</apex:page>
I am using Placeholder js file from Mathias github to solve older IE problems.
Source: https://github.com/mathiasbynens/jquery-placeholder (https://github.com/mathiasbynens/jquery-placeholder" target="_blank)

If the above suggestion worked, let us know by marking the answer as "Best Answer" right under the comment which will help the rest of the community should they have a similar issue in the future. 
Thanks, Sunil
sathishsfdcsathishsfdc
Hi sunil,
Thanks for the reply but i think the solution mentioned above is not working.


IE9





IE10

PFA the screenshots for IE10/IE9
 
Sunil MadanaSunil Madana
Hi Sathish, Its strange.
Please give me some time to give you a workable solution.

Best regards, Sunil.
sathishsfdcsathishsfdc
http://stackoverflow.com/questions/15020826/how-to-support-placeholder-attribute-in-ie8-and-9

i tried the jquery mentioned in this post and it is working...
thanks
This was selected as the best answer
Sunil MadanaSunil Madana
Hi Sathish,
Please mark a "Best Answer" so that rest of the community can refer this in the future. It could be even yours :).
Thanks, Sunil