没有办法点击两个checkbox后 点击submit 把这两个邮件地址插入插入form的text中
<html>
<body>
<h3>phpmailer Test</h3><form name="phpmailer" action="send.php" method="post">
<input type="hidden" name="submitted" value="1"/>
email: <input type="text" size="50" name="address" /><br>
titie: <input type="text" size="50" name="title" /><br>
content: <input type="text" size="50" name="content" />
<br/>
<input type="submit" value="发送"/></form><script>
var add = function(id)
{
if(document.getElementById("address").value==""){
document.getElementById("address").value=id.innerHTML;
}else{
document.getElementById("address").value+=";"+id.innerHTML;
}
}
</script>
<table border=1>
<tr>
<td><input type="checkbox" size="50" name="address" /></td>
<td>lixuenong</td>
<td><a href="javascript:void(1)" onClick="return add(this);">[email protected]</a></td></tr><tr>
<td><input type="checkbox" size="50" name="address" /></td>
<td>lixn</td>
<td><a href="javascript:void(1)" onClick="return add(this);">[email protected]</a></td></tr></table><input type="submit" value="插入地址"/>------------------有没有办法点击两个checkbox后把这两个地址插入插入form中
</body>
</html>
<html>
<body>
<h3>phpmailer Test</h3><form name="phpmailer" action="send.php" method="post">
<input type="hidden" name="submitted" value="1"/>
email: <input type="text" size="50" name="address" /><br>
titie: <input type="text" size="50" name="title" /><br>
content: <input type="text" size="50" name="content" />
<br/>
<input type="submit" value="发送"/></form><script>
var add = function(id)
{
if(document.getElementById("address").value==""){
document.getElementById("address").value=id.innerHTML;
}else{
document.getElementById("address").value+=";"+id.innerHTML;
}
}
</script>
<table border=1>
<tr>
<td><input type="checkbox" size="50" name="address" /></td>
<td>lixuenong</td>
<td><a href="javascript:void(1)" onClick="return add(this);">[email protected]</a></td></tr><tr>
<td><input type="checkbox" size="50" name="address" /></td>
<td>lixn</td>
<td><a href="javascript:void(1)" onClick="return add(this);">[email protected]</a></td></tr></table><input type="submit" value="插入地址"/>------------------有没有办法点击两个checkbox后把这两个地址插入插入form中
</body>
</html>
解决方案 »
- dede后台的sql命令行工具,建表后,表里的中文备注乱码,怎么解决?
- php 文本框问题?
- 如何删除COOKIES(含有数组的)
- 如何用一句MYSQL语句完成以下任务?
- ☆在线等!!!☆PHP调用Java WebService!!!【加急!!!】
- 100分求php-5.0.3-Win32.zip文件
- 求一php分栏函数
- 我在 winxp 下配置php 时为什么会出现这样的问题:IIS中无法添加应用程序扩展名映射,下面的确定按钮是灰色的??100 分奉上!!
- 救命,谁能教教我用odbc联接SQl server的分页的方法
- php+oracle问题
- 请教一个PHP调用MYSQL存储过程的问题(请看这个)
- 能不能将php读取一个文件的过程写入其它如dll文件中?
<html>
<body>
<h3>phpmailer Test</h3>
<form name="phpmailer" action="send.php" method="post">
<input type="hidden" name="submitted" value="1"/>
email: <input type="text" size="50" name="address" id='address'/><br>
titie: <input type="text" size="50" name="title" /><br>
content: <input type="text" size="50" name="content" />
<br/>
<input type="submit" value="发送"/>
</form>
<script>
function add()
{
var divObj = document.getElementsByTagName('input');
var strEmail = "";
for(var i=0; i< divObj.length; i++)
{
if(divObj[i].type == 'checkbox' && divObj[i].name=='address1[]' && divObj[i].checked)
{
if(strEmail != "")
{
strEmail += ";";
}
strEmail += divObj[i].value;
}
}
document.getElementById("address").value = strEmail;
}
</script>
<table border=1>
<tr>
<td><input type="checkbox" size="50" name="address1[]" value="[email protected]"/></td>
<td>lixuenong</td>
<td>[email protected]</td></tr>
<tr>
<td><input type="checkbox" size="50" name="address1[]" value="[email protected]"/></td>
<td>lixn</td>
<td>[email protected]</td></tr></table>
<input type="button" value="插入地址" onclick="add();"/>
</body>
</html>