When adding new records, sometimes we need to automatically add some dynamic content to the specified text field. For example, after uploading a file, the file name is automatically added to an independent record box. Taking the ASP code as an example, the following code implements This function.
The following is the reference fragment: <% if request.querystring ("upload") <> "" then %><script>window.opener.mainform.content.value+='<img>uploadfiles/<%=UploadFormRequest ("file")%></img>';window.close();</script><% end if %>
Code explanation: This behavior is implemented in the opened child window. First use conditional judgment to determine the execution order. If the condition is met, insert a value into the text field of the form named "mainform" in the parent window (the text domain name is content) , and then close the opened child window.
Original text: http://www.pagehome.cn/club/Announce/announce.asp?BoardID=101&ID=643&AUpflag=1&ANum=1