从查找列表中以newform设置值 [英] Setting value in newform from a lookup list

查看:209
本文介绍了从查找列表中以newform设置值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个列表,我们将其称为列表A和列表B.列表B是列表A的查找列表.列表B有两列.列1是查找值.  第2列是一些其他信息.

I have two lists we'll call List A and List B.  List B is a lookup list for List A.  List B has two columns.  Column 1 is the lookup value.  Column 2 is some additional information.

我想做到的是这个.在列表A的新表单中,当从列表B/第1列中选择查找值时,我想用列表B/第2列的值填充新表单中的另一个字段.

What I'd like to make happen is this. In the Newform for List A, when the lookup value is selected from List B/Column 1, I'd like to populate a different field in the Newform with the value from List B/Column 2.

这需要实时进行,因此工作流不会削减它.我正在使用Sharepoint Designer 2010,没有Infopath.  我已经在使用Javascript了,所以这是一个可能的途径.

This would need to happen realtime, so a workflow won't cut it.  I'm working with Sharepoint Designer 2010, no Infopath.  I'm using Javascript in the form already, so that's a possible avenue.

任何建议将不胜感激.

推荐答案

喜剧电影,

请在newform.aspx页面中添加内容编辑器Web部件,并在其中添加以下脚本:

Please add a content editor web part in newform.aspx page and add the script below in it:

<script src="/SiteAssets/jquery-3.2.1.min.js" type="text/javascript">
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2014.02/jquery.SPServices-2014.02.js"></script><script type="text/javascript">


(document).ready(function(){ var ID;
(document).ready(function() { var ID;


('select [title ="lookupfield"]').change(function(){ ID =
('select[title="lookupfield"]').change(function(){ ID =


这篇关于从查找列表中以newform设置值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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