ajax sub page to communicate back to the parent page

假装没事ソ 提交于 2019-12-25 03:16:01

问题


i have a parent page that calls a sub page in a div.

the parent page has a text box

<input name="txtTicketNo" placeholder="Ticket #"  type="text" value="" class="textbox" readonly="readonly" id="txtTicketNo">

when the child page is called it queries the DB and gets the new record ID which lets says is 1271. so in the child page my code piece looks like this.

<input type="hidden" name="sub_tIDi" id="sub_tIDi" value="<%=oRs(0)%>">

Now i want this 1271 to be written into txtTicketNo in the parent page.

This is what i have tried.

var stID;
stID = document.getElementById('sub_tIDi');
opener.document.NewTicket.txtTicketNo.value = stID.value;

the code runs without error, but there is no value in the text box of the parent page.

appreciate your help.

Thanks

来源:https://stackoverflow.com/questions/23517861/ajax-sub-page-to-communicate-back-to-the-parent-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!