Solved

Error when trying to add a comment on my web form

Posted on 2003-11-13
6
285 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
6 Comments
 
LVL 31

Accepted Solution

by:
qwaletee earned 150 total points
Comment Utility
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
Comment Utility
Why is this in Aplications\Email General\Lotus Notes?  It should be in Web Development\Application Servers!
0
 
LVL 31

Expert Comment

by:qwaletee
Comment Utility
Oops, sorry, wrong window on the last comment

0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

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…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now