Solved

Error when trying to add a comment on my web form

Posted on 2003-11-13
6
290 Views
Last Modified: 2013-12-18
I have a add comment button on my form for browser users.  Here is the code

cw=window.open('','','height=150,width=300,status');
cw.moveTo(200,200);
cw.document.write('<html><head><title>Add Comment</title></head>'+
'<body><form><h3>Please Enter Comment</h3>'+
'<textarea name=add_comment_2 rows=2 cols=30></textarea>'+
'<input type=button value=OK '+
'onClick="opener.document.forms[0].Comments.value=\'\';'+
'opener.document.forms[0].CommentHistory.value+=\'\\n\'+'+
'opener.document.forms[0].CommentPrefix.value+'+
'document.forms[0].add_comment_2.value;'+
'opener.document.forms[0].RefreshButton.onclick();window.close()">'+
'<input type=button value=Cancel '+
'onClick="window.close()">'+
'</form></body></html>');
cw.document.close();


The prompt comes up and I can enter a text - then when I hit OK

I get error on page and here is the error

Line: 1
Char: 1
Error: 'opener.document.forms.0.Comments' is null or not a object
Code: 0
URL: Gives the URL
0
Comment
Question by:Jaziar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 31

Accepted Solution

by:
qwaletee earned 150 total points
ID: 9739549
Web browser-wise, you have two forms. Te first form is the "opening" form, which is basically a Notes for, and the pop-up, which is a dynamically-constrcuted form.

The pop-up form is trying to manipulate fields in the main form.  You have to make sure the main form has a field named Comments (not COMMENTS or comments, but Comments).  It also needs fields CommentHistory and CommentPrefix.

So, there are two possibilities:

1) You left out the Comments field somehow, or

2) The field that you do have is not on the form

Possibility 1: A misspelling.  Easy enough to check.  Or a Notes hidden field -- you need either the "generate all fields" option, or to made the field Notes visible but HTML-code TYPE=hidden, or you need to hand-code some pasthru HTML to "make up for" the hidenness.

Possibility 2: You assume forms[0].  Peerhaps you have no form tags, or multiple form tags. So teh field exists, but not in forms[0].  Check the HTML source of the generated page.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9739567
Why is this in Aplications\Email General\Lotus Notes?  It should be in Web Development\Application Servers!
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9739573
Oops, sorry, wrong window on the last comment

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 9739628
The object opener isn't defined anywhere, at least not on the window you create. Try parent.document.forms[0]...
0
 

Author Comment

by:Jaziar
ID: 9739687
Thanks for the promptness - So I added 25 more points - It was the Generate HTML problem.  I also had a problem with the refresh button, but I resolved it.

Thanks Again
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9739692
Jaziar, JS is case sensitive.. ! So Check the spelling of the comment field and replace it accordingly in your button script.

~Hemanth
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question