+ Start a Discussion
Radhika pawar 5Radhika pawar 5 

once checkbox is checked? how to refresh the page or how to call page load

Hi Group,

I have one requirement once i m  clicking on checkbox then  same Page automatically refreshed the Page or reload the Page or it will automatically saved on backend .

using jquey.
My Code Is :-
if (confirm("Does the School Have 1 Camp OR 2 Camps  !") == true)
               {
                   x = "Camp 2!";
                   alert("This School has 2 follow Up Camps :"+x);
                    $("[id$=submit3]").attr("checked", false);
                  var p= $("[id$=submit2yes]").attr("checked", true);
                   
                   
                   
                   }
             else
              {
                x ="Camp 1!";
                alert("This School has 1 Follow Up Camp :"+x);
               $("[id$=submit3]").attr("checked", true);
              
               }


Thanks you,
Rad.

rohitsfdcrohitsfdc
Hello Radhika,
Please provide more details on your requirement. Not able to get the exact requirements
Radhika pawar 5Radhika pawar 5
once i m selecting the checkbox  that time its direcly save in databse.
please provide me code . for this problem

rohitsfdcrohitsfdc
Try using <Apex:actionfunction> vf tag
 
In actionFunction you can define a javascript method which will invoke associated method in conrtoller.


Radhika pawar 5Radhika pawar 5
Hey Rohit plz send me the code or examle
rohitsfdcrohitsfdc
There are two methods to do this :

1)Use @Remote Action Call to call the method

2)Use ACtion Function and call on the event

Here are the documentations for the same

http://www.salesforce.com/us/developer/docs/pages/Content/pages_js_remoting.htm

http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_actionFunction.htm

Video of demo sessions

https://www.youtube.com/watch?v=ckkChgcM9VQ

Summary :Use actionfunction if you need to maintain state between postbacks, remoteaction for stateless invocations
rohitsfdcrohitsfdc
https://success.salesforce.com/answers?id=90630000000hU2kAAE