You need to sign in to do that
Don't have an account?
DeepV
Onclick make inputfield Editable using javascript
Hi all,
I have the inputfield inside the pageblocktable, when the page is display the Role should be readonly.
When the user clicks the button i'e; onclick I want the role field to be editable. How can I do this?
NOTE: each time the user clicks the Add Contact button then the field should be editable.
<apex:pageblocksection title="Contact Information" columns="1">
<apex:pageblocktable value="{!anewContact}" var="item" id="newContactitems" columnsWidth="5%,20%,10%,10%,10%,10%,5%,5%,5%,5%,10%,3%,2%">
<!-- A button to remove individual entry. s
We must to pass the line number to define a list entry number to remove -->
<apex:column headervalue="Delete">
<apex:commandbutton immediate="true" action="{!removeContactObject}" value=" X " rerender="newContactitems,panelWithVar">
<apex:param name="p2" value="{!rowContactNumber}" assignto="{!numberOfContactRowToRemove}" />
</apex:commandbutton>
</apex:column>
<!-- Moreover here we incrementing the row number variable -->
<!--<apex:column headerValue="RowCount">
<apex:outputText value="{!rowContactNumber}"/>
</apex:column>-->
<apex:column headervalue="Role">
<apex:inputfield value="{!item.REL_VS_Contact_Role__c}" html-disabled="{!editMode}"/>
<apex:variable var="rowContactNumber" value="{!rowContactNumber + 1}" />
</apex:column>
</apex:pageblocktable>
I have the inputfield inside the pageblocktable, when the page is display the Role should be readonly.
When the user clicks the button i'e; onclick I want the role field to be editable. How can I do this?
NOTE: each time the user clicks the Add Contact button then the field should be editable.
<apex:pageblocksection title="Contact Information" columns="1">
<apex:pageblocktable value="{!anewContact}" var="item" id="newContactitems" columnsWidth="5%,20%,10%,10%,10%,10%,5%,5%,5%,5%,10%,3%,2%">
<!-- A button to remove individual entry. s
We must to pass the line number to define a list entry number to remove -->
<apex:column headervalue="Delete">
<apex:commandbutton immediate="true" action="{!removeContactObject}" value=" X " rerender="newContactitems,panelWithVar">
<apex:param name="p2" value="{!rowContactNumber}" assignto="{!numberOfContactRowToRemove}" />
</apex:commandbutton>
</apex:column>
<!-- Moreover here we incrementing the row number variable -->
<!--<apex:column headerValue="RowCount">
<apex:outputText value="{!rowContactNumber}"/>
</apex:column>-->
<apex:column headervalue="Role">
<apex:inputfield value="{!item.REL_VS_Contact_Role__c}" html-disabled="{!editMode}"/>
<apex:variable var="rowContactNumber" value="{!rowContactNumber + 1}" />
</apex:column>
</apex:pageblocktable>
Hi,
In your column,
<apex:column headervalue="Role">
<apex:inputfield value="{!item.REL_VS_Contact_Role__c}" html-disabled="{!editMode}"/>
<apex:variable var="rowContactNumber" value="{!rowContactNumber + 1}" />
</apex:column>
If you are setting apex:inputfield to disabled by default then am afraid you won't be able to execute a Javascript function on the onclick event.
That's because disabled elements don't fire mouse events.