+ Start a Discussion

JQuery Communication for Salesforce

Hi All,


I embeded a jquery codes in my custom vf page. What I would like to do is to use the jquery elements (ie, textbox,radio button, links, etc.) to communicate with Salesforce objects that is when a user clicks the save button, records will be created using the data that was filled in from the jquery elements. Please advise on what is the best way to do this kind of scenario. 


Thanks in Advance

Best Answer chosen by Admin (Salesforce Developers) 

The save button might be able to run javascript that copies the data from the jscript components to salesforce hidden components that are inside a salesforce form and would submit the form.


Something like


<submit name="Save" onclick="saveToSF();">



saveToSF = function() {

document.getElementById("{!$Component.SFDCForm1.field1}").value = document.getElementById("Your form fieldid").value;






<apex:form id="form1">

<apex:inputHidden value="{!name}" id="field1" />

<apex:commandButton action="{!yourControllerMethod}" id="submit1" />