|
|
|
| Помогите пожалуйста как можно при помощи JS сохранить и вывести из поля login из всплывающего окна win.php в родительскую страницу index.php
index.php
<html>
<head>
<title>form</title>
</head>
<SCRIPT language="JavaScript">
function winSize(targeturl){
window.open(targeturl,'','width=250, height=30, location=no,toolbar=no,menubar=no,status=no,scrollbars=yes')
}
</SCRIPT>
<body>
<form action="post.php" method="POST">
L_name: <input type="text" name="last_name" /><br>
F_name: <input type="text" name="first_name" /><br>
Login: <input type="text" name="login" /><br>
<a href="" onClick="winSize('win.php')">select login</a><br><br>
<input type="submit" value="add user">
</form>
</body>
</html>
|
win.php (всплывающее окно)
<html>
<head>
<title>win</title>
</head>
<body>
<center>
<form action="index.php" method="POST">
Login: <input type="text" name="login" /><br><br>
<input type="submit" value="save">
</form>
</center>
</body>
</html>
|
http://softtime.ru/forum/read.php?id_forum=1&id_theme=58207&page=1 | |
|
|
|
|
|
|
|
для: aleksej_sumarok
(24.09.2008 в 22:19)
| | Никак. | |
|
|
|
|
|
|
|
для: aleksej_sumarok
(24.09.2008 в 22:19)
| | index.html
<html>
<head>
</head>
<body>
<input id="login" value="" readonly="true" />
<a href="" onclick="winSize('form.html'); return false;">Получить</a>
</body>
<script language="javascript">
function winSize(targeturl){
var popup = window.open(targeturl,'opener','width=250, height=30, location=no,toolbar=no,menubar=no,status=yes,scrollbars=yes')
}
</script>
</html>
|
form.html
<html>
<head>
</head>
<body>
<input id="name" value="" />
<a href="#" onclick="send()">Отправить</a>
</body>
<script language="javascript">
function send(){
opener.document.getElementById('login').value = document.getElementById('name').value;
window.close()
}
</script>
</html>
|
| |
|
|
|