?
Solved

Error when trying to add a comment on my web form

Posted on 2003-11-13
6
Medium Priority
?
292 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 600 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
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: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

649 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