2012-05-30 60 views
-1

我有一个视图,其中我有用户选择从一个模态形式的电子邮件地址,并在主窗体追加值与

<div class="editor-label"> 
     <%: Html.Label("Additional Email Address") %>   
    </div> 

    <div class="editor-field modADLookup">   
     <%: Html.TextBoxFor_Readonly(model => model.AdditionalEmailsSentTo, new {@class = "adEmail", style = "width:500px; height:40px;" })%> 
     <%: Html.SecurityTrimmedActionButton(true, "Search Active Directory", "Index", "ActiveDirectory", null, "clsSearchButton")%> 
    </div> 

假设更新所述文本框中的值从模态形式选定值的MainForm我选择电子邮件[email protected],文本框中的值为“[email protected]”,现在当我下次选择[email protected]时,它会将“[email protected]”替换为“ [email protected]”。

我在寻找的是一种追加电子邮件地址并让文本框保留现有电子邮件ID的方法。

例如:第二次选择后,应该有“[email protected][email protected]”。

如何在主窗体中添加附件?

感谢 苏

回答

0

选择正确的值之后,通过jQuery赶上值,并将其追加到AdditionalEmailsS​​entTo文本框。

$("#SelectListThatContainsValues").change(function() { 
    var newvalue = $(this).val(); 
    var currentValue = $("#AdditionalEmailsSentTo").val(); 
    $("#AdditionalEmailsSentTo").val(currentValue + "," + newValue); 
}); 
:例如,当你选择你的电子邮件中