+ Start a Discussion
shoesmanshoesman 

how to pass the value from javascript to Apex controller

hi all,

 

This is my second posting, please kindly advise me :smileysad:

 

Anyway, what I am trying to make is "math drill", which simply shows like

 

12+3 =

24-9  =

3 *4  =

 

I have code above in javascript, and I want those caluculation to be run by Apex controller,

but I can't figure out how to pass the value from javascript to Apex controller.

 

I have looked for other discussion bords no information found out:<

(this page can be simillar but no exaple on it http://community.salesforce.com/sforce/board/message?board.id=apex&thread.id=13138)

 

I really want to study this so please kindly advise me.....

 

thanks:smileysad:

Best Answer chosen by Admin (Salesforce Developers) 
jeremyyjeremyy
You can define an actionFunction that takes parameters.  These parameters can be bound to controller properties or you can simply access them as page parameters.  actionFunction renders a javascript function that you can call from your javascript.  See this page in the documentation.

All Answers

jeremyyjeremyy
You can define an actionFunction that takes parameters.  These parameters can be bound to controller properties or you can simply access them as page parameters.  actionFunction renders a javascript function that you can call from your javascript.  See this page in the documentation.
This was selected as the best answer
shoesmanshoesman

jeremyy

 

Thanks so so much !!