Welcome Guest, Not a member yet? Register   Sign In
javascript calling controler without form
#1

[eluser]dippy[/eluser]
hello.

i have a content slider on my site using the easySlider plugin

i am now trying to call a controller when the next button is clicked without the page refreshing of course.

i did this with using a form and it works fine. but id like to know if this can be done without a form??

here is what i did for the one that works using the form.
Code:
$("#feedBackForm").submit(function(){

                                                    var str = $(this).serialize();

                                                       $.ajax({
                                                       type: "POST",
                                                       url: "'.site_url().'/contact/feedback",
                                                       data: str,
                                                       success: function(msg){

                                                    $("#note").ajaxComplete(function(event, request, settings){

                                                        if(msg == \'OK\')
                                                        {
                                                            result = \'<div class="notification_ok">Your message has been sent. Thank you!</div>\';
                                                            $("#feedbackFields").hide();
                                                        }
                                                        else
                                                        {
                                                            result = msg;
                                                        }
                                                        $(this).html(result);
                                                    });
                                                    }
                                                    });

                                                    return false;
                                                    });

this is what i have started for the content slider.
Code:
$("#listingSlider").easySlider({nextId: \'listingBtn\', nextText: \'Next Listing\', prevText: \'Previous Listing\', prevId: \'plistingBtn\'});

$("#listingBtn").click(function(){     });

Questions:

How can i call a controller without serializing a form and using POST? can it be done?
Do i have to use a form to pass a variable through?


Messages In This Thread
javascript calling controler without form - by El Forum - 09-24-2009, 02:13 PM
javascript calling controler without form - by El Forum - 09-25-2009, 07:21 AM
javascript calling controler without form - by El Forum - 09-25-2009, 10:08 AM
javascript calling controler without form - by El Forum - 09-29-2009, 07:45 AM
javascript calling controler without form - by El Forum - 09-29-2009, 07:33 PM
javascript calling controler without form - by El Forum - 09-30-2009, 02:09 PM
javascript calling controler without form - by El Forum - 10-01-2009, 09:45 AM
javascript calling controler without form - by El Forum - 10-01-2009, 09:48 AM
javascript calling controler without form - by El Forum - 10-01-2009, 11:06 AM
javascript calling controler without form - by El Forum - 10-01-2009, 11:25 AM
javascript calling controler without form - by El Forum - 10-09-2009, 10:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB