×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Text
Posted by: Simon Lee
Added: Jun 8, 2022 2:59 AM
Views: 7
Tags: no tags
  1.    var myhtml = {
  2.         hcheck1:{
  3.         value:"undefined",
  4.         checked:""
  5.         },
  6.         hgroup1:{
  7.         value:"undefined",
  8.         checked:""
  9.         },
  10.         liselect:{
  11.         value:"0"
  12.         },
  13.         tbox:{
  14.         value:""
  15.         }
  16.         };
  17.         var object = request.post.form;
  18.         for (var name in object)
  19.         {
  20.         var value = object[name];
  21.         if (myhtml.hasOwnProperty(name)){
  22.         myhtml[name].value = value;
  23.         if (myhtml[name].hasOwnProperty("value")){                
  24.         myhtml[name].value = value;
  25.  
  26.         }
  27.         if (myhtml[name].hasOwnProperty("checked")){                
  28.         myhtml[name].checked = "checked";
  29.         checked = "checked";
  30.         }
  31.         }
  32.         };