473,372 Members | 1,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 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 3054
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

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

Similar topics

by: Terence Parker | last post by:
I have a form which enables users to type in some text in a <TEXTAREA>, allowing them to use HTML. I have defined two submit buttons - one to submit as usual, but one which I would like to popup...
by: Piotr | last post by:
I have popup window (window.open) where I put any value in input field. After submit I wan to to return to the main window and get value from popup window. How to close popup window and return to...
by: rked | last post by:
I get nameSPAN1 is undefined when I place cursor in comments box.. <%@ LANGUAGE="VBScript" %> <% DIM ipAddress ipAddress=Request.Servervariables("REMOTE_HOST") %> <html> <head> <meta...
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
by: jwlum | last post by:
I have the following problem under Internet Explorer only: 1. User fills out form data (myform.php) and clicks a button that fires myFunction() 2. myFunction() spawns a "hello, world" popup page...
by: dreamlab | last post by:
Hello, Can one of you javascript wizards help out a newbie, please? I’ve got a formHandler that is supposed to check for a good email address and name in the form after clicking the submit...
by: Tyla | last post by:
I have been teaching myself javascript and i am having a huge problem with this form. All it has to do is check that every field has something in it and then post, but as soon as it gets to the...
by: Anthony | last post by:
I have a form on a web page that requires to click on a button to submit the information. I have two questions about changing this form: 1. Is there a way that I can change the script so that the...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.