I'm trying to disable a button inside of a form region in Oracle Application Express (Apex v3) in an ajax-ified manner. I'm using jQuery to acplish the ajax part.
$('#P16_MYBUTTON').hide();
Doing a view source on the rendered page I noticed that the button doesn't have an ID even though in Apex I've given it a name. I scanned through the rest of the code and noticed that other elements do have an ID. This behavior is somewhat confusing to me.
Any ideas?
I'm trying to disable a button inside of a form region in Oracle Application Express (Apex v3) in an ajax-ified manner. I'm using jQuery to acplish the ajax part.
$('#P16_MYBUTTON').hide();
Doing a view source on the rendered page I noticed that the button doesn't have an ID even though in Apex I've given it a name. I scanned through the rest of the code and noticed that other elements do have an ID. This behavior is somewhat confusing to me.
Any ideas?
Share Improve this question edited Oct 28, 2014 at 11:49 Noelkd 7,9062 gold badges34 silver badges45 bronze badges asked Jul 21, 2010 at 14:42 maximusmaximus 2,4375 gold badges40 silver badges56 bronze badges2 Answers
Reset to default 4Apex 4.0 does assign an ID to each button automatically. In Apex 3.x you can assign one yourself via the button's Attributes property:
id="P16_MYBUTTON"
If the button is an HTML button then that is sufficient to make it work; if the button is based on a template then you need to ensure that the template definition contains the #BUTTON_ATTRIBUTES# substitution string in an appropriate position - for example:
<a class="myButton" href="#LINK#" #BUTTON_ATTRIBUTES#>#LABEL#</a>
I don't know how Apex does its rendering thing, however, you could use another JQuery selector to locate the button, for instance, if you know the ID or html tag name of the direct parent of this button you could use something like:
$('form > button:first').hide()
For future reference, download this refcard:
http://refcardz.dzone./refcardz/jquery-selectors