【发布时间】:2010-03-22 19:53:38
【问题描述】:
我需要通过 JavaScript 在表单中设置字段的值。数据的来源来自另一个来源,通过 IFRAME。我在 IFRAME 的 ASPX 页面的 onload 中运行此代码:
// Get value from source
var currencyText = document.getElementById("contractValue").value;
// Convert that value to a number, stripping out non-number characters.
var currencyNumber = new Number(currencyText.replace(/[^0-9\.]+/g,""));
// Set the value in the CRM field.
parent.crmForm.all.targetCurrencyField.DataValue = currencyNumber;
当我这样做时,我收到一条消息“此控件只接受数字或 null 作为输入”。将值加载到 MS CRM 中的货币字段的可接受方式是什么?
【问题讨论】: