Skip to Main Content

Java Development Tools

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!

How to Disable Adf core input elements by Using JavaScript

637500Jun 30 2008 — edited Jun 30 2008

Hi,

I have to show/hide a adfcore input elements dynamically using javascript.
i tried like this.

<afh:head title="UpdateLawFirm">       
 <meta http-equiv="Content-Type"    content="text/html; charset=utf-8"/>                                    
<afh:script text="             
 function doWork()              {                           
 var e=document.getElementById('updatefrm:branch');            
  var d=document.getElementById('updatefrm:testid');            
  var f=e.selectedIndex;                                      
 if(f==1){             
  d.value='';            
  d.disabled='true';         
     } else if(f==2){                     
    d.disabled='';           
   }                           
 }              "/>    
  </afh:head>
<h:form id="updatefrm">  
<af:selectOneChoice id="branch" autoSubmit="false"                                        
  unselectedLabel="Select" onchange="doWork()" required="true" requiredMessageDetail="Branch selection is required">                        <f:selectItem itemLabel="Branch1" itemValue="b1"/>                        <f:selectItem itemLabel="Branch2" itemValue="b2"/>                      </af:selectOneChoice>                      
<af:inputText columns="20" id="testid'"    value =""/>                                  

Here it is diabling correctly when i select branch1 as a first attempt. but when i am selecting branch2 it is not enabling again.
The above logic is not working. Frank i tried your blog code too. But it is not working.. could anyone help me regarding this.

Thanks,
Arun

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 28 2008
Added on Jun 30 2008
5 comments
892 views