Javascript-форум (https://javascript.ru/forum/)
-   Общие вопросы Javascript (https://javascript.ru/forum/misc/)
-   -   Помогите с iframe (https://javascript.ru/forum/misc/31524-pomogite-s-iframe.html)

crinus 11.09.2012 15:45

Помогите с iframe
 
<head>


<script type="text/javascript">
window.onload=function() {
if (document.getElementById) {
document.getElementById('myForm').onsubmit = function() { return processForm(); }
}
}
function processForm() {
if (document.getElementById) {
if (document.getElementById('input1').value=='') { alert('Enter a file name.'); }
else { document.getElementById('I1').src = document.getElementById('input1').value ; }
return false;
}
}
</script>



<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />


<body>



<img src="allah.png" alt="enter" />
<form name="adress_bar" method="post" action="#" >
<tex><input type="text" size="73" name="input1" id="input1" value="" ></tex>
<loop> <INPUT TYPE=IMAGE SRC="loop.png" > </loop>


<br><iframe id="I1" width="837" height="800" ></iframe>
</body>

Ннада: перейти в iframe по адресу взятому из формы.
Не работает.
help!

lord2kim 11.09.2012 16:06

crinus,
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
  
<link rel="stylesheet" type="text/css" href="style.css" />

<script type="text/javascript">
window.onload=function() {
document.getElementById('myForm').onsubmit = function() { processForm(); return false; }
}

function processForm() {
if (document.getElementById('input1').value=='') { alert('Enter a file name.'); }
else { document.getElementById('I1').src = document.getElementById('input1').value; }
}
</script>
</head>
 
<body>
 
<img src="allah.png" alt="enter" />
<form name="adress_bar" method="post" action="#" id="myForm">
<tex><input type="text" size="73" name="input1" id="input1" value="http://javascript.ru"></tex>
<loop> <INPUT TYPE="image" SRC="loop.png" > </loop>
 
 
<br><iframe id="I1" width="837" height="800"></iframe>
</body>
</html>


Часовой пояс GMT +3, время: 02:13.