How to forward the request after success of ajax request ?
I have this code:
- $("#ajaxform").submit(function(e){
- var info = $(this).serialize();
- $.ajax(
- {
- url : "ctrl1",
- type: "post",
- data : info,
- success:function(data, textStatus, jqXHR)
- {
- $('.valid-error').html(data);
- if(data == "success"){
- $.get("ctrl2", info);
- }
- }
- });
- e.preventDefault()
- });
- $(".submit").click(function(){
- $("#ajaxform").submit();
- });
I am trying to make get request to ctrl2 if my ajax request to ctrl1 success and data == "success". In fact forward the request to another controller after success of ajax request and data == "success". In the HTML I have
#ajaxform and button.