@@ -235,10 +235,10 @@ public static function antiForgeryToken($dynamic = false) {
235235 $ response = self ::$ viewContext ->httpContext ->getResponse ();
236236
237237 if ($ dynamic === true ) {
238- return '<script>document.write( \'<input type="hidden" name="__requestVerificationToken" value=" ' . $ token . '" /> \');</script> ' ;
238+ return '<script>document.write( \'<input type="hidden" name="__requestVerificationToken" id="__requestVerificationToken" value=" ' . $ token . '" /> \');</script> ' ;
239239 }
240240 else {
241- return '<input type="hidden" name="__requestVerificationToken" value=" ' . $ token . '" /> ' ;
241+ return '<input type="hidden" name="__requestVerificationToken" id="__requestVerificationToken" value=" ' . $ token . '" /> ' ;
242242 }
243243 }
244244
@@ -333,6 +333,7 @@ public static function dropDownList($name, $list, $selectedValue = null, $htmlAt
333333
334334 $ htmlAttributes = $ htmlAttributes === null ? array () : $ htmlAttributes ;
335335 $ htmlAttributes ['name ' ] = isset ($ htmlAttributes ['name ' ]) ? $ htmlAttributes ['name ' ] : $ name ;
336+ $ htmlAttributes ['id ' ] = isset ($ htmlAttributes ['id ' ]) ? $ htmlAttributes ['id ' ] : $ name ;
336337
337338 $ result .= '<select ' . self ::buildAttributes ($ htmlAttributes ) . '> ' ;
338339
@@ -488,7 +489,9 @@ public static function listBox($name, $list, $size = 1, $selectedValue = null, $
488489 $ size = 1 ;
489490 }
490491
491- $ htmlAttributes ['name ' ] = $ name = rtrim (isset ($ htmlAttributes ['name ' ]) ? $ htmlAttributes ['name ' ] : $ name , '[] ' ) . '[] ' ;
492+ $ htmlAttributes ['name ' ] = rtrim (isset ($ htmlAttributes ['name ' ]) ? $ htmlAttributes ['name ' ] : $ name , '[] ' ) . '[] ' ;
493+ $ htmlAttributes ['id ' ] = isset ($ htmlAttributes ['id ' ]) ? $ htmlAttributes ['id ' ] : rtrim ($ name , '[] ' );
494+ $ name = $ htmlAttributes ['name ' ];
492495
493496 $ htmlAttributes ['size ' ] = $ size ;
494497 $ htmlAttributes ['multiple ' ] = 'multiple ' ;
@@ -570,6 +573,7 @@ public static function textArea($name, $value = '', $rows = null, $columns = nul
570573 $ htmlAttributes = $ htmlAttributes === null ? array () : $ htmlAttributes ;
571574
572575 $ htmlAttributes ['name ' ] = isset ($ htmlAttributes ['name ' ]) ? $ htmlAttributes ['name ' ] : $ name ;
576+ $ htmlAttributes ['id ' ] = isset ($ htmlAttributes ['id ' ]) ? $ htmlAttributes ['id ' ] : $ name ;
573577
574578 if (self ::getModelValue ($ name , $ modelValue ) === true ) {
575579 $ value = $ modelValue ;
@@ -656,6 +660,7 @@ private static function input($name, $type = 'text', $value = null, $htmlAttribu
656660
657661 $ htmlAttributes ['type ' ] = isset ($ htmlAttributes ['type ' ]) ? $ htmlAttributes ['type ' ] : $ type ;
658662 $ htmlAttributes ['name ' ] = isset ($ htmlAttributes ['name ' ]) ? $ htmlAttributes ['name ' ] : $ name ;
663+ $ htmlAttributes ['id ' ] = isset ($ htmlAttributes ['id ' ]) ? $ htmlAttributes ['id ' ] : $ name ;
659664
660665 if ($ ignoreModelValue !== true && self ::getModelValue ($ name , $ modelValue ) === true ) {
661666 $ value = $ modelValue ;
0 commit comments