Gets the value of the form in the parent window in the Iframe
- 2020-03-29 23:54:46
- OfStack
Part of the code is as follows:
< From Name = "FRM" Action = "bb. Asp >"
< Table>
< Tr>
< Td> < Input Type = "text" Name = "BH" > < / td>
< / tr>
< Tr>
< Td> < Iframe Name = "ScrollFrame" SRC = "aa. Asp" Width = "100%" > < / IFRAME> < / td>
< / tr>
< / table>
< / form>
Question: how to determine whether the value of BH in the form (FRM) is null in aa.asp?
-----------------------------------
Aa. Asp file test code
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
< Script Language = "javascript" >
Function Show () {
If (document. ParentWindow. Parent. The document. The getElementsByName (" BH ") [0]. Value = = "")
Alert (" empty ");
Else
Alert (" not empty ");
}
< / script>
< Input Type = "button" Value = "show" The onclick = "show ();" >