+ Start a Discussion
Vadivel MuruganVadivel Murugan 

How pass apex inputfield value into javascript return Url

<apex:inputField id="sla" value="{!Service_Sheet_STD__c.Order_Date__c}"/> This present one page.
When click the button this page open one vf page.

window.top.location.href ='/'+'{!Service_Sheet_STD__c.id}'+'/e?'+'retURL='+'{!Service_Sheet_STD__c.id}+"&sla="';  i have try this and
window.top.location.href ='/'+'{!Service_Sheet_STD__c.id}'+'/e?'+'retURL='+'{!Service_Sheet_STD__c.id}+"PageRefresh:Form1:complete_page_edit:j_id81:sla="'; with inspect element but not work.

This code present in that page. When  have to close automatically go previous page and clear the above input field using javascript url. In normal custom text field i get inspect element. but input field not work. if any one know reply me.
Use document.getElementById('{!$Component.sla}').value or innerHTML to pass the value of the inputField into the url at Runtime.
window.top.location.href ='/'+'{!Service_Sheet_STD__c.id}'+'/e?'+'retURL='+'{!Service_Sheet_STD__c.id}+&document.getElementById('{!$Component.sla}').value=""

Or, create a function that returns the value of the input and executes the window.top.location at the end of the function. 
function getInputValue(){
var slaURLvalue = document.getElementById('{!$Component.sla}').value;

window.top.location.href ='/'+'{!Service_Sheet_STD__c.id}'+'/e?'+'retURL='+'{!Service_Sheet_STD__c.id}+&slaURLvalue=""


I hope this helps.