jsp代码:
<script language="javascript" type="text/javascript">
function chg (){
if(document.getElementById('mydiv').style.display=="none"){
document.getElementById('mydiv').style.display="";
}
}
</script>
html代码:
echo "<input type='button' value='评论' οnclick='chg()'>
<div id='mydiv' style='display:none;'>
<form id='myform' >
<input type='textbox' id='pinlun' >
<input type='submit' id='sbmt' value='提交' >
</form>
</div>";
、、、、、、、、、、、、、、
<script language="javascript" type="text/javascript">
function review(){
var ret = prompt("请输入评论内容!","");
if (ret == null){
return false;
}else if (ret.replace(/^\s+|\s+$/g,"") == ""){
alert("输入内容为空!");
return false;
}
document.getElementById("TextBox1").value=ret;
}
function transmit(){
var ret = prompt("请输入转发感慨!","");
if (ret == null){
return false;
}else if (ret.replace(/^\s+|\s+$/g,"") == ""){
alert("输入内容为空!");
return false;
}
document.getElementById("TextBox1").value=ret;
}
</script>
$review_button_name='review'.$user_id."_".$row['user_id'];
$transmit_button_name='transmit'.$user_id."_".$row['user_id'];
echo "<a href='blogProcess.php' οnclick='return review()' class='href_style'>评论</a>
<a href='blogProcess.php' οnclick='return transmit()' class='href_style'>转发</a>";