Please help me....
I used and Javascript to view the data. But when i click button open a popup windows, then select data and click save button. The popup close and return the main page, but the textbox value in the main page is undefined
----------------------------------------
here are code main page:
-------------------------------------------
[HTML]<script language="JavaS cript">
var thedata;
var newwin;
var thenumber;
function edit(textarea)
{
if (textarea == 0)
{
thedata = document.frmXul y.hanhvi.value
thenumber = 0
}
newwin = window.open("ha nhvi.htm","","w idth=800,height =600,resizable" )
}
</script>
<html>
<body>
<table>
<tr>
<td width="78%" valign="top"> <fieldset name="Group1" style="width: 362px">
<font size="2">
<legend>Hành vi vi phạm</legend>
<textarea id="hanhvi" name="hanhvi" cols="65" rows="6"></textarea>
</font></fieldset></td>
<td width="22%"> <p>
<input name="button" type="button" onclick="edit(0 )" value="Open">
</p></td>
</tr>
</table>
</body>
</html>[/HTML]
-------------------------------------------
here are code popup page:
--------------------------------------------
[HTML]<HTML>
<HEAD>
<TITLE>Tra cứu hành vi vi phạm</TITLE>
<STYLE>
.catalog_genre_ head {background-color:darkGreen ;font-size:16pt;color :white;font-family:Impact;}
.catalog_head {background-color:green;fon t-size:13pt;color :white;font-family:Impact;}
.catalog_row0 {background-color:lightGree n;font-size:13pt;}
.catalog_row1 {background-color:white;fon t-size:13pt;}
.catalog_row_en d {background-color:darkGreen ;}
</STYLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="Javas cript">
var whichone;
function writedata()
{
whichone = opener.thenumbe r
document.frm_ha nhvi.data.value = opener.thedata
}
function updateit()
{
if (whichone == 0) {
opener.document .frmXuly.hanhvi .value = document.frm_ha nhvi.data.value
}
window.close()
}
</script>
</HEAD>
<BODY onload="writeda ta()">
<form method="post" name="frm_hanhv i">
<H2>TRA CỨU HÀNH VI</H2>
<DIV id="catalog_tab le"></DIV>
<xml id="book_catalo g" src="hanhvi.xml ">
</xml>
<xml id="catalog_fil ter">
<xsl:styleshe et xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="ur n:schemas-microsoft-com:xslt"
version="1.0">
<xslaram name="selected_ genre" select="'all'"/>
<xsl:template match="/">
<div> Chọn lĩnh vực:
<select name="genre" value="{$select ed_genre}" onchange="showG enre(this.value )">
<option value="all"><xs l:if test="$selected _genre='all'">< xsl:attribute name="selected" >Selected</xsl:attribute></xsl:if>All</option>
<option value="dlcl"><x sl:if test="$selected _genre='dlcl'"> <xsl:attribut e name="selected" >Selected</xsl:attribute></xsl:if>Đo lường chất lượng</option>
<option value="shtt"><x sl:if test="$selected _genre='shtt'"> <xsl:attribut e name="selected" >Selected</xsl:attribute></xsl:if>Sở hữu trí tuệ</option>
<option value="atbx"><x sl:if test="$selected _genre='atbx'"> <xsl:attribut e name="selected" >Selected</xsl:attribute></xsl:if>An tòan và kiểm sóat bức xạ</option>
<option value="cgcn"><x sl:if test="$selected _genre='cgcn'"> <xsl:attribut e name="selected" >Selected</xsl:attribute></xsl:if>Chuyển giao công nghệ</option>
</select>
<br/>
<xsl:apply-templates select="catalog "/>
</div>
</xsl:template>
<xsl:template match="catalog" >
<table class="catalog_ table">
<xsl:apply-templates select="hanh_vi[($selected_genr e='all') or ($selected_genr e=./genre)]">
<xsl:sort select="title"/>
</xsl:apply-templates>
</table>
</xsl:template>
<xsl:template match="hanh_vi" >
<xsl:if test="position( )=1">
<tr class="catalog_ genre_head">
<td colspan="6"> <xsl:choose> <xsl:when test="$selected _genre='all'"> Tất
cả lĩnh vực</xsl:when> <xsltherwise> Lĩnh vực: <xsl:value-of select="genre"/>
</xsltherwise> </xsl:choose> </td>
</tr>
<tr class="catalog_ head">
<td>#</td>
<td>Hành vi </td>
<td>Văn bản</td>
<td>Ngày có hiệu lực</td>
<td>Chi tiết</td>
<td></td>
</tr>
</xsl:if>
<tr class="catalog_ row{position() mod 2}">
<td>
<xsl:value-of select="positio n()"/>
</td>
<td class="catalog_ cell"><xsl:valu e-of select="title"/></td>
<td class="catalog_ cell"><xsl:valu e-of select="author"/></td>
<td class="catalog_ cell"><xsl:valu e-of select="publish _date"/></td>
<td class="catalog_ cell">
<textarea cols="40" rows="6" id="data" name="textarea" >
<xsl:value-of select="descrip tion"/>
</textarea>
</td>
<td><input name="button" type="button" onClick="update it()" value="Save" /></td>
</tr>
<xsl:if test="position( )=last()">
<tr class="catalog_ row_end"><td colspan="6"> </td></tr>
</xsl:if> </xsl:template> </xsl:stylesheet> </xml>
<SCRIPT language="JavaS cript">
function loadSource(sour ceObj){
var xmlDoc=new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .5.0");
xmlDoc.async=fa lse;
xmlDoc.load(sou rceObj.XMLDocum ent);
return xmlDoc;
}
var table_proc=null ;
function getProcessor(tr ansformObj){
if (table_proc==nu ll){
var xslDoc=new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .5.0");
var xslTemplate=new ActiveXObject(" Msxml2.XSLTempl ate.5.0");
xslDoc.async=fa lse;
xslDoc.load(tra nsformObj.XMLDo cument);
xslTemplate.sty lesheet=xslDoc;
xslProcessor=xs lTemplate.creat eProcessor();
table_proc=xslP rocessor;
}
else {
xslProcessor=ta ble_proc;
}
return xslProcessor;
}
function transformData(s rcDoc,processor ){
var resultDoc=new ActiveXObject(" MSXML.DOMDocume nt");
processor.input =srcDoc;
processor.outpu t=resultDoc;
processor.trans form();
return resultDoc;
}
function showGenre(genre ){
var srcDoc=loadSour ce(book_catalog );
var processor=getPr ocessor(catalog _filter);
processor.addPa rameter("select ed_genre",genre );
var rsltDoc=transfo rmData(srcDoc,p rocessor);
catalog_table.i nnerHTML=rsltDo c.xml
}
showGenre("all" );
</SCRIPT>
</form>
</BODY>
</HTML>[/HTML]
---------------------------------------------------
Here are xml file hanhvi.xml (popup page)
---------------------------------------------------
[CODE=xml]<?xml version="1.0"?>
<catalog>
<hanh_vi id="bk101">
<title>Danh mục phương tiện đo phải kiểm định do Bộ Khoa học và </title>
<author>Nghị định 59/2007 CP</author>
<genre>dlcl</genre>
<publish_date>1 0-10-2000</publish_date>
<descriptionv ới phương tiện đo khi xuất bán. </description>
</hanh_vi>
<hanh_vi id="bk101">
<title>Danh mục phương tiện đo phải kiểm định do Bộ Khoa học và </title>
<author>Nghị định 59/2007 CP</author>
<genre>dlcl</genre>
<publish_date>1 0-10-2000</publish_date>
<descriptionv ới phương tiện đo khi xuất bán. </description>
</hanh_vi>
<hanh_vi id="bk102">
<title>Hành vi vi phạm quy định về thủ tục xác lập, thực hiện và bảo vệ quyền sở hữu công nghiệp</title>
<author>Luật Sở hữu TT</author>
<genre>shtt</genre>
<publish_date>2 000-12-16</publish_date>
<description>(h ữu công nghiệp;</description>
</hanh_vi>
<hanh_vi id="bk106">
<title>Hành vi vi phạm quyền sở hữu trong chuyển giao công nghệ</title>
<author>Luật chuyển giao công nghệ</author>
<genre>cgcn</genre>
<publish_date>2 000-09-02</publish_date>
<descriptionu ỷ quyền chuyển giao quyền sử dụng công nghệ và gây thiệt hại cho bên nhận công nghệ.</description>
</hanh_vi>
<hanh_vi id="bk107">
<title>Hành vi lợi dụng quyết định phê duyệt hợp đồng chuyển giao công nghệ</title>
<author>Nghị định 61/CP</author>
<genre>cgcn</genre>
<publish_date>2 000-11-02</publish_date>
<description>(K hoản1, Điều 6) đối với hành vi lợi dụng quyết định phê duyệt hợp .</description>
</hanh_vi>
<hanh_vi id="bk108">
<title>Hành vi vi phạm quy định về khai báo</title>
<author>Thông tư 05/TT-BKHCN</author>
<genre>atbx</genre>
<publish_date>2 000-12-06</publish_date>
<descriptionKhô ng khai báo khi tiến hành các công việc bức xạ.</description>
</hanh_vi>
</catalog>[/CODE]
-----------------------------------------------
Please help me fix this error
Thank's verry much
i am waiting........ ...for help
I used and Javascript to view the data. But when i click button open a popup windows, then select data and click save button. The popup close and return the main page, but the textbox value in the main page is undefined
----------------------------------------
here are code main page:
-------------------------------------------
[HTML]<script language="JavaS cript">
var thedata;
var newwin;
var thenumber;
function edit(textarea)
{
if (textarea == 0)
{
thedata = document.frmXul y.hanhvi.value
thenumber = 0
}
newwin = window.open("ha nhvi.htm","","w idth=800,height =600,resizable" )
}
</script>
<html>
<body>
<table>
<tr>
<td width="78%" valign="top"> <fieldset name="Group1" style="width: 362px">
<font size="2">
<legend>Hành vi vi phạm</legend>
<textarea id="hanhvi" name="hanhvi" cols="65" rows="6"></textarea>
</font></fieldset></td>
<td width="22%"> <p>
<input name="button" type="button" onclick="edit(0 )" value="Open">
</p></td>
</tr>
</table>
</body>
</html>[/HTML]
-------------------------------------------
here are code popup page:
--------------------------------------------
[HTML]<HTML>
<HEAD>
<TITLE>Tra cứu hành vi vi phạm</TITLE>
<STYLE>
.catalog_genre_ head {background-color:darkGreen ;font-size:16pt;color :white;font-family:Impact;}
.catalog_head {background-color:green;fon t-size:13pt;color :white;font-family:Impact;}
.catalog_row0 {background-color:lightGree n;font-size:13pt;}
.catalog_row1 {background-color:white;fon t-size:13pt;}
.catalog_row_en d {background-color:darkGreen ;}
</STYLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="Javas cript">
var whichone;
function writedata()
{
whichone = opener.thenumbe r
document.frm_ha nhvi.data.value = opener.thedata
}
function updateit()
{
if (whichone == 0) {
opener.document .frmXuly.hanhvi .value = document.frm_ha nhvi.data.value
}
window.close()
}
</script>
</HEAD>
<BODY onload="writeda ta()">
<form method="post" name="frm_hanhv i">
<H2>TRA CỨU HÀNH VI</H2>
<DIV id="catalog_tab le"></DIV>
<xml id="book_catalo g" src="hanhvi.xml ">
</xml>
<xml id="catalog_fil ter">
<xsl:styleshe et xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="ur n:schemas-microsoft-com:xslt"
version="1.0">
<xslaram name="selected_ genre" select="'all'"/>
<xsl:template match="/">
<div> Chọn lĩnh vực:
<select name="genre" value="{$select ed_genre}" onchange="showG enre(this.value )">
<option value="all"><xs l:if test="$selected _genre='all'">< xsl:attribute name="selected" >Selected</xsl:attribute></xsl:if>All</option>
<option value="dlcl"><x sl:if test="$selected _genre='dlcl'"> <xsl:attribut e name="selected" >Selected</xsl:attribute></xsl:if>Đo lường chất lượng</option>
<option value="shtt"><x sl:if test="$selected _genre='shtt'"> <xsl:attribut e name="selected" >Selected</xsl:attribute></xsl:if>Sở hữu trí tuệ</option>
<option value="atbx"><x sl:if test="$selected _genre='atbx'"> <xsl:attribut e name="selected" >Selected</xsl:attribute></xsl:if>An tòan và kiểm sóat bức xạ</option>
<option value="cgcn"><x sl:if test="$selected _genre='cgcn'"> <xsl:attribut e name="selected" >Selected</xsl:attribute></xsl:if>Chuyển giao công nghệ</option>
</select>
<br/>
<xsl:apply-templates select="catalog "/>
</div>
</xsl:template>
<xsl:template match="catalog" >
<table class="catalog_ table">
<xsl:apply-templates select="hanh_vi[($selected_genr e='all') or ($selected_genr e=./genre)]">
<xsl:sort select="title"/>
</xsl:apply-templates>
</table>
</xsl:template>
<xsl:template match="hanh_vi" >
<xsl:if test="position( )=1">
<tr class="catalog_ genre_head">
<td colspan="6"> <xsl:choose> <xsl:when test="$selected _genre='all'"> Tất
cả lĩnh vực</xsl:when> <xsltherwise> Lĩnh vực: <xsl:value-of select="genre"/>
</xsltherwise> </xsl:choose> </td>
</tr>
<tr class="catalog_ head">
<td>#</td>
<td>Hành vi </td>
<td>Văn bản</td>
<td>Ngày có hiệu lực</td>
<td>Chi tiết</td>
<td></td>
</tr>
</xsl:if>
<tr class="catalog_ row{position() mod 2}">
<td>
<xsl:value-of select="positio n()"/>
</td>
<td class="catalog_ cell"><xsl:valu e-of select="title"/></td>
<td class="catalog_ cell"><xsl:valu e-of select="author"/></td>
<td class="catalog_ cell"><xsl:valu e-of select="publish _date"/></td>
<td class="catalog_ cell">
<textarea cols="40" rows="6" id="data" name="textarea" >
<xsl:value-of select="descrip tion"/>
</textarea>
</td>
<td><input name="button" type="button" onClick="update it()" value="Save" /></td>
</tr>
<xsl:if test="position( )=last()">
<tr class="catalog_ row_end"><td colspan="6"> </td></tr>
</xsl:if> </xsl:template> </xsl:stylesheet> </xml>
<SCRIPT language="JavaS cript">
function loadSource(sour ceObj){
var xmlDoc=new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .5.0");
xmlDoc.async=fa lse;
xmlDoc.load(sou rceObj.XMLDocum ent);
return xmlDoc;
}
var table_proc=null ;
function getProcessor(tr ansformObj){
if (table_proc==nu ll){
var xslDoc=new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .5.0");
var xslTemplate=new ActiveXObject(" Msxml2.XSLTempl ate.5.0");
xslDoc.async=fa lse;
xslDoc.load(tra nsformObj.XMLDo cument);
xslTemplate.sty lesheet=xslDoc;
xslProcessor=xs lTemplate.creat eProcessor();
table_proc=xslP rocessor;
}
else {
xslProcessor=ta ble_proc;
}
return xslProcessor;
}
function transformData(s rcDoc,processor ){
var resultDoc=new ActiveXObject(" MSXML.DOMDocume nt");
processor.input =srcDoc;
processor.outpu t=resultDoc;
processor.trans form();
return resultDoc;
}
function showGenre(genre ){
var srcDoc=loadSour ce(book_catalog );
var processor=getPr ocessor(catalog _filter);
processor.addPa rameter("select ed_genre",genre );
var rsltDoc=transfo rmData(srcDoc,p rocessor);
catalog_table.i nnerHTML=rsltDo c.xml
}
showGenre("all" );
</SCRIPT>
</form>
</BODY>
</HTML>[/HTML]
---------------------------------------------------
Here are xml file hanhvi.xml (popup page)
---------------------------------------------------
[CODE=xml]<?xml version="1.0"?>
<catalog>
<hanh_vi id="bk101">
<title>Danh mục phương tiện đo phải kiểm định do Bộ Khoa học và </title>
<author>Nghị định 59/2007 CP</author>
<genre>dlcl</genre>
<publish_date>1 0-10-2000</publish_date>
<descriptionv ới phương tiện đo khi xuất bán. </description>
</hanh_vi>
<hanh_vi id="bk101">
<title>Danh mục phương tiện đo phải kiểm định do Bộ Khoa học và </title>
<author>Nghị định 59/2007 CP</author>
<genre>dlcl</genre>
<publish_date>1 0-10-2000</publish_date>
<descriptionv ới phương tiện đo khi xuất bán. </description>
</hanh_vi>
<hanh_vi id="bk102">
<title>Hành vi vi phạm quy định về thủ tục xác lập, thực hiện và bảo vệ quyền sở hữu công nghiệp</title>
<author>Luật Sở hữu TT</author>
<genre>shtt</genre>
<publish_date>2 000-12-16</publish_date>
<description>(h ữu công nghiệp;</description>
</hanh_vi>
<hanh_vi id="bk106">
<title>Hành vi vi phạm quyền sở hữu trong chuyển giao công nghệ</title>
<author>Luật chuyển giao công nghệ</author>
<genre>cgcn</genre>
<publish_date>2 000-09-02</publish_date>
<descriptionu ỷ quyền chuyển giao quyền sử dụng công nghệ và gây thiệt hại cho bên nhận công nghệ.</description>
</hanh_vi>
<hanh_vi id="bk107">
<title>Hành vi lợi dụng quyết định phê duyệt hợp đồng chuyển giao công nghệ</title>
<author>Nghị định 61/CP</author>
<genre>cgcn</genre>
<publish_date>2 000-11-02</publish_date>
<description>(K hoản1, Điều 6) đối với hành vi lợi dụng quyết định phê duyệt hợp .</description>
</hanh_vi>
<hanh_vi id="bk108">
<title>Hành vi vi phạm quy định về khai báo</title>
<author>Thông tư 05/TT-BKHCN</author>
<genre>atbx</genre>
<publish_date>2 000-12-06</publish_date>
<descriptionKhô ng khai báo khi tiến hành các công việc bức xạ.</description>
</hanh_vi>
</catalog>[/CODE]
-----------------------------------------------
Please help me fix this error
Thank's verry much
i am waiting........ ...for help
Comment