创建多选复选框选择列表 [英] Creating a Multi-Select Checkbox-Picklist

查看:73
本文介绍了创建多选复选框选择列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

:doh:我正在尝试创建多选复选框"选择列表,我正在使用Microsoft Dynamics 4.0托管合作伙伴.我知道默认情况下MSCRM不提供任何选择控件,要实现这一点,我必须使用Java Script进行自定义. Java脚本中的以下代码段用多选复选框样式选择列表"控件替换了帐户表单"中的ShipCode选择列表控件.我的问题是我的代码不允许我保存选择的值.我尝试使用Jim Wang的代码

http://blogs.msdn.com/b/crm/archive/2009/03/31/crm-4-0-checkbox-style-multi-select-picklist.aspx [

:doh: I am trying to create a Multi Select Checkbox-Picklist, I am using Microsoft Dynamics 4.0 Hosted Partner. I know that MSCRM by default does not provide any control for multiple selection, To make this happen I have to go for customiziation using Java Script. The following code snippet in Java script replaces the ShipCode picklist control in Account Form with a Multi Select Checkbox Style Picklist Control. The Problem I am having is my code does not allow me to save the values that I select. I have tried using the code from Jim Wang

http://blogs.msdn.com/b/crm/archive/2009/03/31/crm-4-0-checkbox-style-multi-select-picklist.aspx[^]
This code did not even create a checkbox for me on my form. So i used this script, and it works,as far as creating the checkbox on the form and allowing me to select multiple values. It just will not save my values when I save and Close the account. Any help will greatly be appreciated. This is the code:

var ShipCode = crmForm.all.address1_shippingmethodcode;

ShipCode.style.display = "none";

var addDiv = document.createElement("<div style='overflow-y:auto; height:100px; border:1px#6699cc solid; background-color:#ffffff;' />");

ShipCode.parentNode.appendChild(addDiv);

for( var i = 1; i < ShipCode.options.length; i++ )
 {
  var SCOption = ShipCode.options[i];

  var addInputCheckBox = document.createElement("<input type='checkbox' style='border:none; width:20px; align:left;' />" );

  var addLabel = document.createElement( "<label />");
  addLabel.innerText = SCOption.text;

  var addBr = document.createElement( "br");

  ShipCode.nextSibling.appendChild(addInputCheckBox);
  ShipCode.nextSibling.appendChild(addLabel);
  ShipCode.nextSibling.appendChild(addBr);
 }


谢谢
钻石
[删除电子邮件]


Thank you,
Diamond
[Email removed]

推荐答案

有人真正编辑过代码本身吗?我需要此脚本来保存所选的值.请帮助我.
Did anyone actually edit the code itself? I need this script to save the values selected. Please help me.


这篇关于创建多选复选框选择列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆