I wanted to go to yiichina to ask, but the above is very watery, basically only the webmaster occasionally replied! It is similar to the three-level linkage of a city. After selecting a level, the next level of classification is listed in the next drop-down box, but I am used for my classification. In fact, I can use html + js + php, just...
I wanted to go to yiichina to ask, but the above is very watery, basically only the webmaster occasionally replied!
It is similar to the three-level linkage of a city. After selecting a level, the next level of classification is listed in the next drop-down box, but I am used for my classification. In fact, I can use html + js + php, but this will discard it.yii
The built-in form generation method also loses verification!
You can use your own method for the moment. If you have any idea, change itYII
Style ~
Reply content:
I wanted to go to yiichina to ask, but the above is very watery, basically only the webmaster occasionally replied!
It is similar to the three-level linkage of a city. After selecting a level, the next level of classification is listed in the next drop-down box, but I am used for my classification. In fact, I can use html + js + php, but this will discard it.yii
The built-in form generation method also loses verification!
You can use your own method for the moment. If you have any idea, change itYII
Style ~
Yii2 itself does not have any plug-ins for linking results. It is concatenated with other classes, but you can write plug-ins yourself. No yii2 example. I have previously written about the linkage effect of yii1. You don't want to lose your own verification, as long as the input name is the same as that in the model.
// View
DropDownList ($ blog, 'mid ', CHtml: listData (Metas: model ()-> parents (), 'mid', 'name '), array ('class' => 'form-control', 'empty' => array ('0' => 'select class '), 'onchange' => 'ajaxgetarea (this) ');?> Error ($ blog, 'mid ');?>
// JsYii: app ()-> clientScript-> registerScript ('metas', 'function ajaxGetArea (obj) {// request address var link = "'. yii: app ()-> createUrl ("/cms/metas/json "). '"; // request data $. post (link, {parent: $ (obj ). val ()}, function (data) {// clear the select $ (obj) of the subclass ). parent (). nextAll ("p "). each (function () {$ (this ). remove () ;}); if (data! = "-1") {// construct the html var select = null for the sub-class select; // Add the onchange event select ="Select category"; $. Each (data, function (key, item) {select + =""+ Item. name +"";}); Select + ="
"; // Insert to the right, upper level $ (obj ). parent (). after (select); // trigger the dynamic loading of the next subclass select // $ (obj ). next ("select "). trigger ("change", function () {// ajaxGetArea ($ (this); //}); // update the name Position $ (obj ). removeAttr ("id"); $ (obj ). next ("select "). attr ("id", "Articles_mid"); $ (obj ). removeAttr ("name"); $ (obj ). next ("select "). attr ("name", "Articles [mid]") ;}, "json") ;}', CClientScript: POS_END );
Http://www.cnsecer.com/7140.html don't thank me