471,853 Members | 844 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,853 software developers and data experts.

Please help me! I Submit a popup, return textarea in the main page is undefined

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="JavaScript">
var thedata;
var newwin;
var thenumber;
function edit(textarea)
if (textarea == 0)
thedata = document.frmXuly.hanhvi.value
thenumber = 0

newwin = window.open("hanhvi.htm","","width=800,height=600, resizable")
<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>
<td width="22%"> <p>
<input name="button" type="button" onclick="edit(0)" value="Open">
here are code popup page:
<TITLE>Tra cứu hành vi vi phạm</TITLE>
.catalog_genre_head {background-color:darkGreen;font-size:16pt;color:white;font-family:Impact;}
.catalog_head {background-color:green;font-size:13pt;color:white;font-family:Impact;}
.catalog_row0 {background-color:lightGreen;font-size:13pt;}
.catalog_row1 {background-color:white;font-size:13pt;}
.catalog_row_end {background-color:darkGreen;}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="Javascript">
var whichone;
function writedata()
whichone = opener.thenumber
document.frm_hanhvi.data.value = opener.thedata
function updateit()
if (whichone == 0) {
opener.document.frmXuly.hanhvi.value = document.frm_hanhvi.data.value

<BODY onload="writedata()">
<form method="post" name="frm_hanhvi">

<DIV id="catalog_table"></DIV>

<xml id="book_catalog" src="hanhvi.xml">

<xml id="catalog_filter">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

<xslaram name="selected_genre" select="'all'"/>

<xsl:template match="/">

<div> Chọn lĩnh vực:
<select name="genre" value="{$selected_genre}" onchange="showGenre(this.value)">
<option value="all"><xsl:if test="$selected_genre='all'"><xsl:attribute name="selected">Selected</xsl:attribute></xsl:if>All</option>
<option value="dlcl"><xsl:if test="$selected_genre='dlcl'"><xsl:attribute name="selected">Selected</xsl:attribute></xsl:if>Đo lường chất lượng</option>
<option value="shtt"><xsl:if test="$selected_genre='shtt'"><xsl:attribute name="selected">Selected</xsl:attribute></xsl:if>Sở hữu trí tuệ</option>
<option value="atbx"><xsl:if test="$selected_genre='atbx'"><xsl:attribute name="selected">Selected</xsl:attribute></xsl:if>An ṭan và kiểm sóat bức xạ</option>
<option value="cgcn"><xsl:if test="$selected_genre='cgcn'"><xsl:attribute name="selected">Selected</xsl:attribute></xsl:if>Chuyển giao công nghệ</option>

<xsl:apply-templates select="catalog"/>

<xsl:template match="catalog">
<table class="catalog_table">
<xsl:apply-templates select="hanh_vi[($selected_genre='all') or ($selected_genre=./genre)]">
<xsl:sort select="title"/>

<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 class="catalog_head">

<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>
<tr class="catalog_row{position() mod 2}">
<xsl:value-of select="position()"/>
<td class="catalog_cell"><xsl:value-of select="title"/></td>
<td class="catalog_cell"><xsl:value-of select="author"/></td>
<td class="catalog_cell"><xsl:value-of select="publish_date"/></td>
<td class="catalog_cell">
<textarea cols="40" rows="6" id="data" name="textarea">
<xsl:value-of select="description"/>

<td><input name="button" type="button" onClick="updateit()" value="Save" /></td>
<xsl:if test="position()=last()">
<tr class="catalog_row_end"><td colspan="6"> </td></tr>
</xsl:if> </xsl:template> </xsl:stylesheet> </xml>

<SCRIPT language="JavaScript">
function loadSource(sourceObj){
var xmlDoc=new ActiveXObject("Msxml2.FreeThreadedDOMDocument.5.0" );
return xmlDoc;

var table_proc=null;

function getProcessor(transformObj){
if (table_proc==null){
var xslDoc=new ActiveXObject("Msxml2.FreeThreadedDOMDocument.5.0" );
var xslTemplate=new ActiveXObject("Msxml2.XSLTemplate.5.0");
else {
return xslProcessor;

function transformData(srcDoc,processor){
var resultDoc=new ActiveXObject("MSXML.DOMDocument");
return resultDoc;

function showGenre(genre){
var srcDoc=loadSource(book_catalog);
var processor=getProcessor(catalog_filter);
var rsltDoc=transformData(srcDoc,processor);
Here are xml file hanhvi.xml (popup page)
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?>
  2. <catalog>
  3. <hanh_vi id="bk101">
  4. <title>Danh mục phương tiện đo phải kiểm định do Bộ Khoa học và </title>
  5. <author>Nghị định 59/2007 CP</author>
  6. <genre>dlcl</genre>
  7. <publish_date>10-10-2000</publish_date>
  8. <descriptionvới phương tiện đo khi xuất bán. </description>
  9. </hanh_vi>
  10. <hanh_vi id="bk101">
  11. <title>Danh mục phương tiện đo phải kiểm định do Bộ Khoa học và </title>
  12. <author>Nghị định 59/2007 CP</author>
  13. <genre>dlcl</genre>
  14. <publish_date>10-10-2000</publish_date>
  15. <descriptionvới phương tiện đo khi xuất bán. </description>
  16. </hanh_vi>
  17. <hanh_vi id="bk102">
  18. <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>
  19. <author>Luật Sở hữu TT</author>
  20. <genre>shtt</genre>
  21. <publish_date>2000-12-16</publish_date>
  22. <description>(hữu công nghiệp;</description>
  23. </hanh_vi>
  25. <hanh_vi id="bk106">
  26. <title>Hành vi vi phạm quyền sở hữu trong chuyển giao công nghệ</title>
  27. <author>Luật chuyển giao công nghệ</author>
  28. <genre>cgcn</genre>
  29. <publish_date>2000-09-02</publish_date>
  30. <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>
  31. </hanh_vi>
  32. <hanh_vi id="bk107">
  33. <title>Hành vi lợi dụng quyết định phê duyệt hợp đồng chuyển giao công nghệ</title>
  34. <author>Nghị định 61/CP</author>
  35. <genre>cgcn</genre>
  36. <publish_date>2000-11-02</publish_date>
  37. <description>(Khoản1, Điều 6) đối với hành vi lợi dụng quyết định phê duyệt hợp .</description>
  38. </hanh_vi>
  39. <hanh_vi id="bk108">
  40. <title>Hành vi vi phạm quy định về khai báo</title>
  41. <author>Thông tư 05/TT-BKHCN</author>
  42. <genre>atbx</genre>
  43. <publish_date>2000-12-06</publish_date>
  44. <descriptionKhông khai báo khi tiến hành các công việc bức xạ.</description>
  45. </hanh_vi>
  47. </catalog>
Please help me fix this error
Thank's verry much
i am waiting...........for help
Sep 18 '07 #1
2 2850
5,390 Expert Mod 4TB
hi thuythu,

welcome to TSDN ...

please use the code tags when posting code ...

kind regards
Sep 18 '07 #2
5,390 Expert Mod 4TB
hi ...

for textareas don't use value ... use innerHTML instead ...

kind regards
Sep 18 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Terence Parker | last post: by
1 post views Thread by Piotr | last post: by
2 posts views Thread by rked | last post: by
2 posts views Thread by Tyla | last post: by
3 posts views Thread by Anthony | last post: by
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.