2016-08-15 71 views
0

我正嘗試使用Netsuite創建一個在線表單。如何更改netsuite中的字段類型?

我們有像名字,姓氏等預定義的字段一套

在我們有一個

NLSUBSCRIPTIONS

標籤,但默認情況下,字段類型爲下降相同與多個選擇選項。

如何將此下拉菜單更改爲複選框?

+0

什麼類型的在線形式的這是什麼?這將有助於在哪裏做出改變。 – W3BGUY

回答

0

如果您使用自定義模板,您可以隱藏下拉列表並迭代其選項來創建自己的複選框。

例如

<div class="regFieldWrap"> 
     <span class='cbExpand hideNsLabel'><NLCUSTENTITY_LIST_FIELD></span><input class="otherShadow valid" type="text" name="custentity_list_field_other"><span class="multiProto cbHolder"><input type="radio" name="custentity_list_field"><label class="cbLabel"></label></span> 
    </div> 

然後

<script> 
jQuery(function($){ 
     // convert multi select to checkbox 
     $("span.multiProto").each(function(){ 
      var proto = this; 
      var selName = $(proto).find("input").attr("name"); 
      var otherCB = null; 
      $("select[name='"+selName+"']").css({display:'none'}).each(function(){ 
       var sel = $(this); 
       var isReq = sel.hasClass('inputreq'); 
       if(isReq) sel.removeClass('inputreq'); 
       sel.find("option").each(function(){ 
        if(!this.value) return; 
        var newby = $(proto.cloneNode(true)); 
        var cb = newby.find("input").val(this.value); 
        if(isReq) cb.addClass('cb_selectone'); 
        newby.find("label.cbLabel").text(this.text); 
        $(newby).removeClass('multiProto'); 
        if((/\bother\b/i).test(this.text)){ 
          var otherField = $("input.otherShadow[name='"+ selName+"_other']").each(function(){ 
           var newOther = this.cloneNode(true); // strange but it gets around an IE issue 
           $(this).remove(); 
           $(newby).find("input").data("conditionalOther", newOther); 
           newby.get(0).appendChild(newOther); 
          }); 
          otherCB = newby; 
        } else proto.parentNode.insertBefore(newby.get(0), proto); 
       }); 
       sel.get(0).options.length = 0; 
      }); 
      if(otherCB) proto.parentNode.insertBefore(otherCB.get(0), proto); // make sure this is the end element 
     }); 

}); 
+0

非常感謝您的幫助。它會真的幫助我 – ndh

相關問題