Support the ongoing development of Laravel.io →
Requests Views Forms
Last updated 2 years ago.
0

Try this in your if: if( title == true)

Last updated 2 years ago.
0

Without the error message and controller code it will be difficult to help.

Last updated 2 years ago.
0

TorchSK said:

Without the error message and controller code it will be difficult to help.

thanks for reply .when I click on add btn the console output gives me the 404 not found error and refer to this line of my jquery main file that I downloded from http://code.jquery.com/jquery-latest.min.js:

it is :

 f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void          0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort(); 
Last updated 2 years ago.
0

jonitopsg said:

Try this in your if: if( title == true)

thanks for reply . I tried this . it just go to "else" part . but when I write if(title!=null) it shows me the same problem that I wrote to TorchSK.

Last updated 2 years ago.
0

Do you have your

Route::post('add', ... ) 

defined correctly in routes.php?

Last updated 2 years ago.
0

TorchSK said:

Do you have your Route::post('add', ... ) defined correctly in routes.php?

it's my route for /add:

Route::post('/add', function()  /// I tested with get too . for both of them it gives me the same 404 error

{
    return 'The Request is AJAX!';
});
Last updated 2 years ago.
0

Paste the entire routes.php please. Use http://laravel.io/bin

Are you sure, that the request by ajax is to http://mydomain.com/add with POST method? It seem OK from the code though :)

Last updated 2 years ago.
0

TorchSK said:

Paste the entire routes.php please. Use http://laravel.io/bin

Are you sure, that the request by ajax is to http://mydomain.com/add with POST method? It seem OK from the code though :)

I really thanks for your reply. it's my code http://laravel.io/bin/2ezaM

Last updated 2 years ago.
0

I am little confused. The route is different then you pasted before. But never mind.
Do you have

  public $restful = true;

In your controller?

Last updated 2 years ago.
0

TorchSK said:

I am little confused. The route is different then you pasted before. But never mind.
Do you have

 public $restful = true;

In your controller?

yes I did. when I click the Add btn .it's my console reaction https://www.filepicker.io/api/file/2NDGQ6smTSyY6zglecL9

Last updated 2 years ago.
0

Have you tested the form without ajax?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

prgmsaha prgmsaha Joined 20 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.