2017-05-04 4 views
0

페이지에 두 개의 버튼과 두 개의 다른 프레임이 있습니다. 버튼 1을 클릭하면 프레임 a에 표시하고 버튼 2를 클릭하면 프레임 b에 표시합니다. 어떤 이유로 버튼이 다른 프레임에 표시되도록 할 수 없습니다. 한 프레임 만.HTML 버튼 타겟팅

몇 가지 테스트를 수행했는데 유일한 문제는 첫 번째 양식 액션 태그에있는 것 같습니다. 버튼 태그의 타겟은 쓸모가 없습니다.

도와주세요! 별도의 형태로 버튼을 넣어

<body> 
<center> 
<form action="test.php" method="post" target="frame_a"> 
<button type="submit" name="action" value="Active" 
target="frame_a">Active</button> 
<button type="submit" name="action1" value="Completed" 
formaction="test2.php" target="frame_b">Completed</button> 
</td> 
</form> 

<iframe width="900" height="1000" src="" name="frame_a" width="100%" 
height="100%"></iframe> 

<iframe width="900" height="1000" src="" name="frame_b" width="100%" 
height="100%"></iframe> 

</body> 
+1

http://stackoverflow.com/a/26253115/4229270 – Sinto

답변

0

시도

<form action="test.php" method="post" target="frame_a"> 
    <button type="submit" name="action" value="Active" 
target="frame_a">Active</button> 
</form> 

<form action="test.php" method="post" target="frame_b"> 
    <button type="submit" name="action1" value="Completed" formaction="test2.php" target="frame_b">Completed</button> 
</form>