function setCn(row){
var sURL = "*.jsp?
type=cc&random="+new Date().getTime();"
var vArguments = new Object();//對話框經過window.dialogArguments來取得傳遞進來的參數。
vArguments.win=window;//把當前窗口的引用當參數傳進去
vArgument
s.str=$(row).val();//要傳進去的其餘參數
var sFeatures = "dialogHeight:350px;dialogWidth:550px;center:yes;resizable:yes;status:no;location:no;menubar:no;titlebar:no;";
var vReturn=window.showModalDialog(sURL,vArguments,sFeatures);
if(undefined != vReturn){
$(row).val(vReturn);
}
}
<style type="text/css">
#main { height: auto; width: auto;float: left; }
</style>
<script type="text/javascript">
var arg=window.dialogArguments;
var pa =
${param.type};
$(function(){
$("#kk").val(
arg.str);
if(pa == 'cc'){
$("#title").html("");
}else{
$("#title").html("");
}
})
function submitForm(){
var v = $("#abc").val();
var result=
v.match(/^\w+(\.)\w+$/); //將匹配的對象做爲數組返回
if(result ==null){
$("#abc").focus();
alert("格式不對");
return ;
}
if(pa == 'cc'){
var r = (/[\u4e00-\u9fa5]+/ig)
.test($.trim(v));//是否包含
if(r){
alert("error data!");
$("#abc").focus();
return ;
}
}
window.
returnValue=cnValue; window.close(); } </script> </head> <body> <form id="form" action="" method="post"> <div id="main"> <table id="Table" width="100%" border="0" align="center" > <tr > <th id="title" align="center"></th> </tr> <tr > <td width="100%" height="90%"> <s:textarea cols="65" rows="18" id="abc"></s:textarea></td> </tr> </table> <span><a href="javascript:void(0);" onclick="submitForm();">肯定</a></span> </div> </form>