1

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

    <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() ?>
4

1 回答 1

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'] 
于 2012-12-26T10:16:44.097 回答