文本框不接受弹出窗口值

时间:2012-12-26 10:02:36

标签: php html

我有一个文本框,当我点击它弹出窗口打开,但当我在弹出窗口中选择任何无线电选项时,文本框中没有插入值,问题出在哪里? 这是文本框

    <tr><td> Work </td>
                <td><input title="Enter Work You Want to search ." readonly="readonly" id="search_workind" name="search_workind" type="text" size="20"  onclick="javascript:opendrop()">                
</td></tr>

这个调用函数

function opendrop()
{
var popy= window.open('search_kind.php','popup_form','width=380 height=300 left=800 top=300');
}

这是search_kind.php

<?php ob_start() ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Search </title>
<script type='text/javascript'> 
function validepopupform()
{
    window.opener.document.getElementById('search_workind').value=" " 
//self.close();

} 
</script>

</head>

<body>
<form  id="popupform" name="popupform">
<h3>Audit and Assurance</h3>
<input name="kind" type="radio" id="kind" value="A" onclick="javascript:validepopupform()" />A
<br/>
<input name="kind" type="radio" id="kind" value="B" onclick="validepopupform()" />B
<br/>
</form>

</body>

</html>
<?php ob_flush() ?>

1 个答案:

答案 0 :(得分:1)

您无法在onclick上设置文本框数据;在search_kind.php中 添加提交按钮,  然后

<td><input title="Enter Work You Want to search ." readonly="readonly" id="search_workind" name="search_workind" type="text" size="20"  onclick="javascript:opendrop()"> value=$_POST['kind']