简体   繁体   English

将数据从弹出窗口传递到页面

[英]Passing data from popup to page

i have a basic form where the users of an ERP can create ticket for quick support. 我有一个基本表格,ERP的用户可以在其中创建票证以获得快速支持。 In the form they have to put the client ID, but i want them to click a search icon to open a pop up (or something similar) and select the client. 在表单中,他们必须放置客户端ID,但是我希望他们单击​​搜索图标以打开弹出窗口(或类似内容)并选择客户端。

客户表格

In the pop up i want to load a list of client, and when they select the client, send de ID to the main page where they are creating the ticket... 在弹出窗口中,我想加载一个客户列表,当他们选择客户时,将ID发送到他们创建票证的主页上。

How can i do this? 我怎样才能做到这一点?

I use the next script to send data from child to main page: 我使用下一个脚本将数据从子级发送到主页:

$("button").click(function() {
    var data = $(this).val();
    window.opener.document.getElementById('cliente-nombre').value = data;
    window.parent.close();
  });

and in the button wich open the popup: 在弹出的按钮中:

function openNominaCliente() {
     window.open("/clientes/nomina", "popupId", "location=no,menubar=no,titlebar=no,resizable=no,toolbar=no, menubar=no,width=500,height=500"); 
     }

Thanks all! 谢谢大家!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM