In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains the "Yii2.0 mode pop-up box and ajax submission form example usage", the article explains the content is simple and clear, easy to learn and understand, now please follow the editor's train of thought slowly in depth, together to study and learn "Yii2.0 mode pop-up box and ajax submission form example usage" bar!
For example, we use the modal pop-up box + ajax to submit the form. First we add the create button of the index view to data-toggle and data-target.
The code is as follows:
Add the following code to the index view to display the modal pop-up box:
The effect of the modification is as follows
Then we modify the create method in the controller and change the render to renderAjax.
Return $this- > renderAjax ('create', [' model' = > $model,])
If we want to add form validation, we need to modify the _ form in views and add id
Point to your models to add verification rules public function rules () {return to rules ['tasking checking dates,' tasking dayscodes, 'tweeds reasoned,' tweeds nicknameworthy dagnamestaments'], 'required'], [[' tweeds dated dates, 'tweeds dated enddates'], 'safe'], [[' tasking days'], 'number'], [[' tasking reasoning]] 'string'], [[' type', 'add_time',' uid', 'update_time',' status', 'is_shen'],' integer'], [['tweeted pickling,' tweeted nickname passages'], 'string',' max' = > 20], [['tweeimg,' reviewer_user', 'audit_user'],' string', 'max' = > 255]] }
The effect is as follows
This enables the ajax to submit the form
Thank you for your reading, the above is the "Yii2.0 mode pop-up box and ajax submission form example usage" of the content, after the study of this article, I believe you on the Yii2.0 mode pop-up box and ajax submission form example usage of this problem has a deeper understanding, the specific use of the need for you to practice verification. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.