NewForm.aspx With Multi-Select Column - Add New Value From NewForm.aspx and Refresh Page Issue


  • Hello All - I have a custom NewForm.aspx in SP 2010 Foundation that has several lookup columns that are allowing multi-select. I am allowing the user to add a new value to the list that generates the lookup column via a piece of javascript (see below). When they click the link the newform.aspx for the lookup column list appears in a modal window. 

    All is well except I did not take into consideration when the user has entered values in other fields, and when they close the lookup column newform.aspx modal window, that the "location.reload(true);" I am using refreshes the entire page and wipes the values they have in the other fields.

    Any suggestions on the best way to handle this?

    Thanks and appreciate your help!

    <script type="text/javascript"> 
    							var options = { 
    							url: &quot;/Lists/MyMSDNExampleLookupList/NewForm.aspx&quot;, 
    							        title: &quot;Add New Category&quot;, 
    							        allowMaximize: true, 
    							        showClose: true, 
    							        width: 625, 
    							        height: 255, 
    							        dialogReturnValueCallback: silentCallback}; 
    							function open() {SP.UI.ModalDialog.showModalDialog(options);} 
    							function silentCallback(dialogResult, returnValue) { 
     location.reload(true);								;
    						<a href="javascript:open()">Add Category</a>	
    04 Mayıs 2012 Cuma 17:42