?
Solved

Error when trying to add a comment on my web form

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

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

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