You need to sign in to do that
Don't have an account?
Surya Kiran
How to Access Output Field (Inline edit enabled) values using javascript from Visualforce page
Hi,
I want to access Output field values from javascript. when I was accessing that record from visualforce page I enabled Inline edit for that field. I used document.getElementById("").InnerHTML. But I am getting entire innerHTML properties with span and div tags instead of text.
Any Ideas for this.
I want to access Output field values from javascript. when I was accessing that record from visualforce page I enabled Inline edit for that field. I used document.getElementById("").InnerHTML. But I am getting entire innerHTML properties with span and div tags instead of text.
Any Ideas for this.
I got the solution.
var selectedValue = document.getElementById("id").options[document.getElementById("id").selectedIndex].value;
All Answers
you can try using document.getElementById("").value and see if it gets you only the value..
Sample:
<apex:outputText Id="unitPrice"....>
Invocation of js function - onblur = "compute('{!$Component.unitPrice}');"
JS function -
function compute(unitPriceId)
{
var cost = document.getElementById(unitPriceId).innerHTML;
............
}
document.getElementById("").value is not working incase of Output fields. It is working for Input fields.
When coming to .innerHTML it is working for only output fields without inline edit. If I enabled Inline edit its not giving an exact value.
<apex:outputField value="{!Object.field}" >
<apex:inlineEditSupport showOnEdit="saveButton, cancelButton" hideOnEdit="editButton" event="ondblclick" changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
</apex:outputField>
I got the solution.
var selectedValue = document.getElementById("id").options[document.getElementById("id").selectedIndex].value;