Welcome Guest, Not a member yet? Register   Sign In
sending data to the controller using java
#1

[eluser]Brain Coder[/eluser]
hey all

i have a problem using the jquery and send the form data to the contoller

the ajax function

Code:
$.post('submit.php',$(this).serialize()+'&ajax=1',
                
                    function(data){
                        if(parseInt(data)==-1)
                            $.validationEngine.buildPrompt("#captcha","* Wrong verification number!","error");
                            
                        else
                        {
                            $("#contact-form").hide('slow').after('<h1>Thank you!</h1>');
                        }
                        
                        $('#loading').css('visibility','hidden');
                    }
                
                );

i want to send the data to the controller
contact/index

wut the changes in this line
'submit.php',$(this).serialize()+'&ajax=1',

to submit the data

hope u can understand me guys

thanks
#2

[eluser]WebsiteDuck[/eluser]
Code:
var formData = $(":input").serialize();
$.post('submit.php',formData+'&ajax=1',
...
#3

[eluser]Brain Coder[/eluser]
Thanks for your replay

i have solve the problem by this code
Code:
$.post('http://127.0.0.1/Globiaudit/index.php/contact/index', $("#contact-form").serialize(),

now i need to change the link i tried to make it like this
index.php/contact/index

but it didnt work
can u help me with that please




Theme © iAndrew 2016 - Forum software by © MyBB