Changeset 6163


Ignore:
Timestamp:
Nov 3, 2017, 11:46:23 AM (2 years ago)
Author:
joamuran
Message:

Fixed formfactory creation for selects and ckeckboxes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin-center/trunk/fuentes/admin-center.install/usr/share/admin-center/lib/formFactory.js

    r3234 r6163  
    2020    sel+='<div class="'+right_col_size+'">';
    2121    sel+='<select id="'+item.id+'" class="form-control" '+disabled+'>';
     22    item.default=item.default.replace("\n", "");
    2223    for (var i in item.options){
    2324        var selected="";
    24         if (item.options[i].value==item.default) selected=' selected ';
     25        //alert("123");       
     26        //alert(item.options[i].value +typeof(item.options[i].value)+ "==="+item.default +typeof(item.default)+"->"+(item.options[i].value===item.default));
     27        if (item.options[i].value===item.default) selected=' selected ';
    2528        sel+="<option "+selected+" value="+item.options[i].value+">"+item.options[i].label+"</option>";
    2629    }
     
    4043    var checked="";
    4144    var disabled="";
    42     if (item.default=="checked") checked=" checked ";
     45    //if (item.default=="checked") checked=" checked ";
     46    if (item.default=="checked" || item.default=="true") checked=" checked ";
    4347    if (item.disabled=="true") disabled=" disabled ";
    4448    var content='<div class="form-group col-md-12" title="'+item.help+'">';
Note: See TracChangeset for help on using the changeset viewer.