I am trying to grab a visual force element using jQuery and having some trouble.
In my source my save button looks like this:
<apex:commandButton id="saveButton" value="Save"/>
And in my document.ready I have this statement:
alert('button value ' + $("[id$=saveButton]").value);
But all I get when I load the page is:
‘button value undefined’.
Eventually I want to disable the button programmatically from within a JavaScript function, but I don’t think I am even able to grab the element.
The chrome inspector says my element looks like this:
<input id="j_id0:frm:searchBlock:saveButton" type="submit" name="j_id0:frm:searchBlock:saveButton" value="Save" onclick="saveButtonClicked();" class="btn" disabled="disabled">
Any suggestions?
To disable: