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
Vetriselvan ManoharanVetriselvan Manoharan 

jquery not working with VF page

Hi,

I have a Visual force page which uses a component. I need to assign value for textbox in a component through JQuery for some IE 9 placeholder issue. I tried something like this

var placeholderText = 'Contribute a post..';
        $(window).load(function() {
            $('#newPostContent').val(placeholderText);
        });

When it loads it shows the text and after loading it disappears.Any ideas?
Himanshu ParasharHimanshu Parashar
what is the error you are getting ?
Vetriselvan ManoharanVetriselvan Manoharan
errors.. I can the value in textbox, but after loading the value gets cleared
Himanshu ParasharHimanshu Parashar
can you please try following code.
 
$( document ).ready(function() {
     var placeholderText = 'Contribute a post..';
     $('#newPostContent').val(placeholderText);
});

 
Vetriselvan ManoharanVetriselvan Manoharan
I tried it and it doesn't work. It shows up the value and after loading it clears..
Himanshu ParasharHimanshu Parashar
ok, can you please post your vf page and component so that I can have a look any other issue ?