Symfony 4 Beginners: Dynamically modify a form (AJAX)

  Рет қаралды 37,155

OverSeas Media

OverSeas Media

Күн бұрын

Пікірлер: 63
@larsstecken
@larsstecken 5 жыл бұрын
At times a bit rushed, but hey, I learned more than by studying docs for hours. Real-world problems explained really well. Thanks for sharing and as the others say - can't wait for the next one.
@MarcoAntonio-gi4tz
@MarcoAntonio-gi4tz 6 жыл бұрын
Hey man, I just discovered the series. I will watch them all. In a time where there are tons of Laravel tutorials. I find this channel outstanding. keep going!
@OverSeasMedia
@OverSeasMedia 6 жыл бұрын
Thank you so much for taking the time to say those kind words. I absolutely appreciate it . Cheers mate :))
@jeanfmart
@jeanfmart Жыл бұрын
Thank you Sir. Still valid today. Made my day !
@rickaxelmouwendzilegandza3663
@rickaxelmouwendzilegandza3663 3 жыл бұрын
Thank you. But, How to do the same thing with 3 fields one after the other?
@szymond.9048
@szymond.9048 2 жыл бұрын
And what if I want to add nother field based on subcategories field? How can I achieve that?
@0ElChaza0
@0ElChaza0 6 жыл бұрын
This was a very clear video thank you so much man!! After all the headaches lol... i'll get into it again and see if i can adapt it to my code. Greetings from Argentina.
@OverSeasMedia
@OverSeasMedia 6 жыл бұрын
Hey there dude . I hope this will kind help get the result you're looking for . And thanks fr the idea in the first place lol . You inspired this video actually . Cheers and good luck man :))
@gerseystelmach6501
@gerseystelmach6501 Жыл бұрын
Thank you very much! You saved my day!
@linomoreau376
@linomoreau376 2 жыл бұрын
Hello, I have a little problem and I'm stuck. When I send my data with ajax I get this error: - Expected argument of type "string", "null" given at property path "username". I believe the data submitted to my controller's method that creates the form is causing a problem.
@zahidkhankhan
@zahidkhankhan 4 жыл бұрын
excellent work offcourse its help a lot to understand the missing puzzles.. keep going man ..
@ValeriyTuz
@ValeriyTuz 2 жыл бұрын
Hi. Many thanks for the tutorial! I did similar functionality in Symfony2 and now going to do the same with Symfony5. When I did it in Symfony2 - the doc and tutorials were to the events PRE_SUBMIT, not the POST_SUBMIT. But new docs says to use POST_SUBMIT. And I'm wondering - why? What is the benefit of using POST_SUBMIT. I did not dive very deep yet into it but for the moment it seems to me that POST_SUBMIT looks more complicated: you have to get the element of form and then getParent since in PRE_SUBMIT you work with array of formData
@Question_Authority
@Question_Authority 4 жыл бұрын
Hey, Im really curious about how you made the dropdown to work without using the entitytype after ->add(sub_category). it gives me an "Object of class App\Entity.. could not be converted to string... could you give me a hand with that one?? cheers
@OverSeasMedia
@OverSeasMedia 4 жыл бұрын
Hello there mate, I can see the line you're referring to, I think the problem in your case is that the class that you're using does no implement the __toString function? so that could probably fix the issue (Not sure though), so try adding the function inside the class that is in the error "Object of class App\Entity\ThisClass" and just return some string value and if that does not work, let me know. Cheers mate :)
@Question_Authority
@Question_Authority 4 жыл бұрын
​@@OverSeasMedia Yes sir, that worked perfectly. Thanks a lot, Appreciate your reply!
@ragiththomas9510
@ragiththomas9510 6 жыл бұрын
I watched all your tutorial series of Symfony4, it's very clearly explained and very useful. Thank you very much.
@OverSeasMedia
@OverSeasMedia 6 жыл бұрын
You're most welcome and thank you for the nice comment really appreciate it, I'm glad this was helpful . Cheers mate :)
@ragiththomas9510
@ragiththomas9510 6 жыл бұрын
If I include, use symfony\Component\HttpFoundation\Request at the top of my controller just below the namespace App\Controller, it showing the error like class "symfony\Component\HttpFoundation\Request" but no such service exists. What should I do for this, actually I am new to Symfony so I was referring your video
@OverSeasMedia
@OverSeasMedia 6 жыл бұрын
Hey there could you please tell me where are you using this ? Is it a function inside the controller? Also try changing the use from symfony to Symfony (capitalized) that might be source of the problem.
@ragiththomas9510
@ragiththomas9510 6 жыл бұрын
Actually, I was trying to create a Routing as you did in the 6-Symfony 4 Beginners The Controller tutorial video. I have created a function name as "show" inside the controller and passing the parameters ( Request $request, $slug) and the Route mentioned as @Route("/test/{slug}", name="test") and, I have written use Symfony\Component\HttpFoundation\Request at the top of the controller class just below the namespace App\Controller then, if I execute in the browser as 127.0.0.1:8000/test/2 , I get the error as Class "symfony\Component\HttpFoundation\Request" but no such service exists
@OverSeasMedia
@OverSeasMedia 6 жыл бұрын
Did just check that out didn't misspell symfony in the use statement . Bellow the namespace it should be "use Symfony...." And not "use Symfony..." (Pay attention that the "s" in symfony should be capitalized
@Question_Authority
@Question_Authority 3 жыл бұрын
This video has been really useful to me, thanks man!
@OverSeasMedia
@OverSeasMedia 3 жыл бұрын
I'm glad it was helpful mate. Cheers :)
@Evilmaster667
@Evilmaster667 3 жыл бұрын
Great tutorial! But I get a database entry for the onchange function and another for the submit type. Why is this happening? Normally the entry should have been updated, right?
@ZahidHasan-jf3ne
@ZahidHasan-jf3ne 4 жыл бұрын
How can I add EntityType add new like collectionType or like sonata admin EntityType add new. Please ans sir. Thank you.
@asialata2781
@asialata2781 2 жыл бұрын
Please help ! I cant see any data in my "subcategory" form field and i cant see what i did wrong. Do you know what the reason can be? thanks a lot!
@OverSeasMedia
@OverSeasMedia 2 жыл бұрын
Hey sorry I was not aware of you issue just got around to reading comments, I hope you managed to fix your issue.
@youssefessaddik3372
@youssefessaddik3372 5 жыл бұрын
tks a lot , what if there more than 2 select ? what should we do on that case ?
@HorrorShow
@HorrorShow 5 жыл бұрын
Interesting tutorial, thank you very much, but what would have to change if the relationship between post and subcategories was ManyToMany?
@OverSeasMedia
@OverSeasMedia 5 жыл бұрын
Thank your for your feedback . It's been quite a while and I don't remember exactly what I did in this video lol . But I assume that you want to chat get the drop-down list of subcategories right ? Which means you want to be able to select multiple subcategories (like a tags system) correct? Well if that's the case I can point you to a video that I made when I was just getting started with this channel and it's called custom type , it's kind of a long video so you can just skim through it and see it's any help, if it was helpful you just have to combine the two things together. If that's not what you're looking for then feel free to send me an email explaining what you're trying to do and we can discuss it more :)
@HorrorShow
@HorrorShow 5 жыл бұрын
@@OverSeasMedia No problem, I solved it. Although this code is still magic for me, I still don't understand why it works. The FormEvents operates in POST_SUBMIT, however, jQuery detects the change in the Category field without submitting, in real time, but each time the user changes Category the jQuery emulates a submit and replaces the old subcategory field with the one that returns the POST_SUBMIT form? It's a bit confusing, but it works!
@OverSeasMedia
@OverSeasMedia 5 жыл бұрын
Yeah that what happens . If it doesn't make sense at the moment . Just come back to it later . This type of things happens :)
@Question_Authority
@Question_Authority 3 жыл бұрын
Mate, here I go again... I made the listener work but... do you add the SubmitType in the view? cuz it 's certainty not in the form, cant figure
@OverSeasMedia
@OverSeasMedia 3 жыл бұрын
Yes I might've added it in the view I cannot remember . You can add It in the type of you want, the important thing is to have a way to submit the form :)
@parijke
@parijke 4 жыл бұрын
Actually this is what I meant. Forget my question on your latest video! Again, very helpfull
@OverSeasMedia
@OverSeasMedia 4 жыл бұрын
Sorry I'm quite late but I'm glad you found this :)
@abdb7174
@abdb7174 6 жыл бұрын
thank u man please we're waiting for a real project on symfony 4
@OverSeasMedia
@OverSeasMedia 6 жыл бұрын
You're most welcome I'll see if I can make something together and start recording it sometime in the future . Cheers and thank you again. :)
@bettonvillebenoit1533
@bettonvillebenoit1533 5 жыл бұрын
Great ! ... but could you explain how can we implement this in a embbeded form ? I tried it but I have an error because getData() return Null. Thx :-)
@OverSeasMedia
@OverSeasMedia 5 жыл бұрын
Aight hold on a second this is gonna require some serious attention lol, which function or line is returning null for the getData(), do you have a repository for this ? Looking at the code is much better thank just interrogating you haha. (Sorry for the late response :) )
@bettonvillebenoit1533
@bettonvillebenoit1533 5 жыл бұрын
Hi, Oops ... it's my fault ! I did a typo in the code ... It's works !! Thanks for you video ;-)
@adrianfgutierrez2836
@adrianfgutierrez2836 4 жыл бұрын
Woowwwww excelent work ✌🏽
@younex111
@younex111 6 жыл бұрын
hey bro thank you so much for this amazing series lol it 3:12am and im still watching the tutos its really wonderful keep going you are the better in youtube lol and i have i blame for you you start one task and you didn't done it yet. it's the crud with upload image you only upload it and save it so i hope you could make a short video for how to edit it will be awsome its 3 days im looking but no way thank you so much again and god bless you
@OverSeasMedia
@OverSeasMedia 6 жыл бұрын
Hey there youness you're most welcome . I'll definitely see if I can make a short video about that in the shortest time possible . Meanwhile . Get some sleep dude lol . Cheers :)
@younex111
@younex111 6 жыл бұрын
hey bro thank you so much lol i only slept 4 hours from 5am to 9am still looking for fixing this problem if you cant make it soon send me the controller how should be please or a shot screen or anything could help im really stuck and that hurt my mind god bless you bro
@OverSeasMedia
@OverSeasMedia 6 жыл бұрын
Hey there I actually made a video about this before lol and I didn't even realize it . Could you please check the doctrine events video I think the first part covers what you're trying to do . (Not really sure if that's what you're trying to do ) but hey check it out and let me know if it was helpful or not . (Sorry for not mention this before I totally forgot about this)
@younex111
@younex111 6 жыл бұрын
thank you so much brother i guess its very helpfull it use events lol im still didnt get into this level i made mine without events i will show you my shootscreen and let me know please
@younex111
@younex111 6 жыл бұрын
this the link : drive.google.com/open?id=1TcMtx00cw-VdiEG-CvKAng8HfJyO_n5g you will see the controller : ( upload ) + (delete) + (update) and script file only the (update) messed up (@_@) ° ° ° ° i have an other blank night again bro i hope you could help as soon possible thank you again brother
@mahdibeldjoudi3269
@mahdibeldjoudi3269 5 жыл бұрын
thank you so much man
@OverSeasMedia
@OverSeasMedia 5 жыл бұрын
You're most welcome mate . Cheers from Morocco :)
@bolovy6093
@bolovy6093 6 жыл бұрын
Thank you very much bro! +1 like
@OverSeasMedia
@OverSeasMedia 6 жыл бұрын
Thank you very much and I appreciate that mate . Cheers and thanks for the support :)
@chimerablack4913
@chimerablack4913 4 жыл бұрын
How can it possibly be this much code and effort to make a dropdown list? No wonder this framework has 0% market share with a total of 13k websites ever. Seems like Symfony needs a new framework built on top of it just to use Symfony. Seriously. If I'm using a framework it should be as easy as "Create:dropdown". Not 3 pages of code. I mean.. are dropdowns a new thing? How many decades does it take to simplify creating them into one command?
@OverSeasMedia
@OverSeasMedia 4 жыл бұрын
I agree with you that Symfony takes a lot of boilerplate code to make something really basic, but then it gets absolutely extremely easy to make changes (If you have a really well written code ofc). One other thing about Symfony is that it is used much more on the enterprise level, because it works in a way that kind of forces people to write the same thing and follow the same "coding scheme". If you need help with something feel free to ask, If you decide to not use Symfony I completely understand I myself at first skipped, what ever you decide mate I wish you the best of luck :)) Cheers
@mohamedaymenabdennour7918
@mohamedaymenabdennour7918 4 жыл бұрын
Thank you
Symfony 4 & Doctrine: QueryBuilder
30:12
OverSeas Media
Рет қаралды 22 М.
9 - Symfony 4 Beginners: Forms
27:01
OverSeas Media
Рет қаралды 24 М.
Когда отец одевает ребёнка @JaySharon
00:16
История одного вокалиста
Рет қаралды 16 МЛН
REAL 3D brush can draw grass Life Hack #shorts #lifehacks
00:42
MrMaximus
Рет қаралды 12 МЛН
Monster magnet meets microwave magnetron...
17:44
Brainiac75
Рет қаралды 48 М.
5: How to validate a form using AJAX - Learn AJAX programming
35:27
Dani Krossing
Рет қаралды 192 М.
Do NOT Learn Kubernetes Without Knowing These Concepts...
13:01
Travis Media
Рет қаралды 313 М.
8 - Symfony 4 Beginners: Doctrine & Database interaction
24:39
OverSeas Media
Рет қаралды 10 М.
7 - Symfony 4 Beginners: Twig
22:22
OverSeas Media
Рет қаралды 10 М.
Symfony Forms Tutorial
16:57
Gary Clarke
Рет қаралды 25 М.
This is the Only Right Way to Write React clean-code - SOLID
18:23
17 - Symfony 4 Beginners: Services
26:30
OverSeas Media
Рет қаралды 12 М.
Up & Running With Symfony 4 - Part 1: Setup, Controllers, Twig
32:48
Traversy Media
Рет қаралды 191 М.