Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

jQuery "setting all items to READONLY based on a page item" not working

sect55Dec 12 2010 — edited Dec 21 2010
I am attempting to use jQuery to set all input fields to "readonly" if the question is in "locked" status (i.e., if P2_QUESTION_LOCKED page item is set to yes ("Y")). The following is the code that I placed in the page attributes (in the javascript section):
if ($x('P2_QUESTION_LOCKED') )
   {
   if ($x('P2_QUESTION_LOCKED') == 'Y') 
      {
       $(document).ready(
       function() {    $('input').attr('readonly','readonly'); });
      }
   }
It is not working. All input fields are available for input. I used Firefox 1.6 and Firebug and I have no errors. What am I missing?

An example is set up in APEX.ORACLE.COM:
Workspace: RGWORK
Application: Financial Disclosure (Application 45806)
User Name: TESTER
Password: test123
Run the application, and click on 'Update Current Year's' from the list.

Robert
http://apexjscss.blogspot.com


Robert
This post has been answered by jariola on Dec 14 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 18 2011
Added on Dec 12 2010
40 comments
5,118 views