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

javascript or jquery

window.open

Do what you need and close the window.

Last updated 2 years ago.
0

Thanks for reply.

I need some clarity on several aspects. Let me break it up.

  1. There are two areas where an use can create a "Nationality". First one being the "Nationality" view where one can create, edit and delete. This one is fine and working. Second area is from the create Student view. Since a Student relates to a Nationality. So for creating a Nationality from the create Student view via a modal popup:
  • How can I use the same create controller method for both scenarios? When user creates nationality from students view I would like to redirect back to students view BUT when creating nationality from the first area I would redirect to a different view (index.nationality).

How will I best manage this?

Last updated 2 years ago.
0

Could you use a popup for this also, and when updated have a button to finally close the popup. If you are not familiar with jquery ajax, you should goto the w3schools.com site. Sounds like what you
are doing is a good candidate for a combination of php, your views, and jquery ajax. You could actually
have jquery close and open another popup.

Last updated 2 years ago.
0

Yup Jim I am doing a popup. And yes I do have acceptable jquery ajax knowledge :)

But what I am struggling to foresee is how will I be able to:

  1. Close the Popup with Javascript / jQuery
  2. Also submitting the form to my store() Controller Method to save the new entry all on one button click?

Please advice :) Thanks.

Last updated 2 years ago.
0

Marius0188 said:

  • How can I use the same create controller method for both scenarios? Use seperate controller methods if possible since two different things.
    As far as the popup, add a close button the user can click when all done.
    Is Nationality and Student always created at the same time?
    Redirect according to a condition, kinda like a login, where a successful login
    takes you to a page an unsuccessful login may goto an error page.
    Sounds like you almost have it, just having to figure some if else elseif logic
    and redirects.
Last updated 2 years ago.
0

i create two layouts. One call default.blade.php where i put all the menus, scc, .js, etc...and other one called partilal.blade.php that i remove the menus. Then i reate views/forms that use the partial.blade.php. So when i open a modal with bootstrap via javascript i dont see the menu. So basically i load the view into a modal box and the show the modal.

  $('.edit').on('click', function () 
  {
    var id = $(this).attr("id"); //get the id from the line
 
   $('#loadForm').load(domain+'/item/'+id)//load a view into a modal

    $('#modalEditEntry').modal('show'); //show the modal

  });
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Marius0188 marius0188 Joined 25 Nov 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.