Solved

Error when trying to add a comment on my web form

Posted on 2003-11-13
6
287 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
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
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Missing Rules 1 301
Lotus Notes to MS Exchange mailfile migration 4 54
Mobile Iron iphone stop receiving new mails 6 1,314
Disable some Lotus eMail users for a period of time 4 67
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 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