?
Solved

Can someone tell me why this does not work?

Posted on 2003-02-28
30
Medium Priority
?
214 Views
Last Modified: 2013-12-18
This is a button action on the web side - I am using Java script.  Should open a dialog box, the user should type a text string in, then a field on the form is populated.  

Right now the box comes up and I can type in it - press ok and thats it nothing else happens.

cw=window.open('','','height=120,width=200');
cw.moveTo(200,200);
cw.document.write('<html><head><title>Add Comment</title></head>'+
'<body><form><h3>Please Enter Comment</h3>'+
'<input type=text name=add_comment_2><br>'+
'<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();
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
  • 16
  • 14
30 Comments
 

Author Comment

by:Jaziar
ID: 8043757
I guess I should include what I am doing on the notes Client

add_comment_1 := @Prompt([OKCANCELEDIT]; "Add Comment"; "Please Enter Comment"; " ");
add_comment_2 := @Name([CN]; @UserName) + " " + @Text @Now) + @NewLine + add_comment_1;
@SetField("CommentHistory"; CommentHistory:add_comment_2);
@SetField("Comments"; "");  

Only the CommentHistory field shows all others are hidden.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8043813
Hello Jaziar,

did you not receive the notification about my comment?

Anyway, I am glad abut the new offering. My very special Bro just managed to steal again my points :-)

I will give this code again a test and look for possible error traps.

We could speed up the process when you would send your database to zvonko@mysite.de
Zip it when greater then 3MB.

0
 

Author Comment

by:Jaziar
ID: 8043973
I did not see it until after I posted this question.  
0
Independent Software Vendors: 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 63

Expert Comment

by:Zvonko
ID: 8044121
Ok, now main pit fall is the wrong field name encapsulation in JavaScript.

Do your Notes fields spell exactly like this:
Comments
CommentHistory
and the button html name: RefreshButton

Also is absolute necessary that your Form has this property enabled:
GenerateHtmlForAllFields

Please check this again and send me your db if you can.

0
 

Author Comment

by:Jaziar
ID: 8044160
Comments
CommentPrefix
CommentHistory

RefreshButton

Yes GenerateHtmlForAllFields is checked but
Treat documents contents as HTML is not checked.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8044208
Which browser do you use for testing? IE or NS?
In IE you will get small error icon in lower left corner.
In NS you have to type javascript: to get the error console.

Increase the popup window size and request status to see the error.

Here are the changes:

cw=window.open('','','height=620,width=600,status');
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8044250
I just recreated a new form with cut and pasted code from here and it works.

Please send me this database.

0
 

Author Comment

by:Jaziar
ID: 8044303
I can not send the database - Company policies - All databases are confidental - Sorry
0
 

Author Comment

by:Jaziar
ID: 8044341
OK it is now adding the comment to the form which is great but when I hit refresh but the dialog box is not closing.
0
 

Author Comment

by:Jaziar
ID: 8044349
error says error on page when I hit OK
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8044396
OK, now double-click this error in lower left corner of the popup window and you will get an error dialog window.

Tell me what error occurred.

0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8044408
Oh, now I read: you get the comment when you hit refresh?
Ok, then the remote RefreshButton click failed.

Check again for correct spelling of html NAME of this button.

0
 

Author Comment

by:Jaziar
ID: 8044494
'opener.document.forms[0].RefreshButton.onclick();window.close()">'+  is null or not a object

The name of the button and the code match
0
 

Author Comment

by:Jaziar
ID: 8044540
THis is the source code on the actual page -

return false;" HREF="">Add Web Comment</A></TD><TD><A HREF="" onClick="return _doClick('e8a50a3d91db5f3c85256ccc0065c980/$V5ACTIONS/0.52D2', this, null)" TARGET="_self">RefreshButton</A></TD></TR>
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8044542
There is something wrong with this error message.

Please compare your html code in browser to mine.
Or paste here your html of the pupup so I can compare.

Here is mine:
<html><head><title>Add Comment</title></head><body><form><h3>Please Enter Comment</h3><input type=text name=add_comment_2><br><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>


0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8044571
What do you mean with "actual page"?
Is this the parent Form where the AddComment button reside?

And your RefreshButton is NOT a button!

0
 

Author Comment

by:Jaziar
ID: 8044589
HEre is the popup source

<html><head><title>Add Comment</title></head><body><form><h3>Please Enter Comment</h3><input type=text name=add_comment_2><br><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>
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8044608
I have an idea: send me the complete text of html source of your web page.

You have my address? zvonko@mysite.de

0
 

Author Comment

by:Jaziar
ID: 8044643
Sorry I meant I viewed the source code on the form - The buttons are on top of the form - I have (Add Web Comment) (RefreshButton) these buttons
0
 

Author Comment

by:Jaziar
ID: 8044658
I sent it
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8044686
Both, (Add Web Comment)and (RefreshButton) are NOT buttons.
They are HotSpot links. They can not have html names.
You see this on the <A> html tags.
The buttons look like this in html:
<INPUT TYPE=button VALUE="Refresh" NAME="RefreshButton" onClick="return _doClick('522e617550f08a96c1256cdb006e1627/$Body/0.646', this, null)">

So now you have to create a Button anywhere on the main Form and give it this @Formula:
@Command([ViewRefreshFields])

In the property dialog for this Button enter in the last tab labeled with <HTML> this options:
Name: RefreshButton
Style: display:none

0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8044727
Ok, I got your html code.

Now I see. This <A> tags are not HotSpots, this are Actions!

For Actions it is not possible to give them html names.
So please create a real Button for this RefreshButton.

0
 

Author Comment

by:Jaziar
ID: 8044786
I tried it but I get the same thing - I will be back Monday morning - I must be missing something - for all your time more points
0
 

Author Comment

by:Jaziar
ID: 8044818
I can only create a Hotspot button - should it be hidden? or will they need to click it
0
 

Author Comment

by:Jaziar
ID: 8044836
Should the comment button also be a real button and not a action tag?
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8044858
AddWebComment works now as is, so let it be.
But RefreshButton needs to be clickable by JavaScript, and this can be done only by real html buttons. The button does not need to be visible for the web user. It has only to be callable by JavaScript.

See you on Monday :-)

0
 

Author Comment

by:Jaziar
ID: 8057217
OK I have the button working :) - but is there a way we can put a save in the script somewhere.  I adds the comment to the form but does not save it.  So we I reopen the form the comment is gone.  We are getting there.
0
 
LVL 63

Accepted Solution

by:
Zvonko earned 2000 total points
ID: 8057331
CommentHistory is only an Item on you main Document.
If you like that CommentHistory is stored, then you have to Save the Document.

Simply add the Save command to RefreshButton formulas.
Like this:

@Command([ViewRefreshFields]);
@Command([FileSave])

That's all.


0
 

Author Comment

by:Jaziar
ID: 8057408
Thanks for the hard work and staying with me during all my trails and errors.  It was very important I get this working and thanks to your help it is.  Job well done!!
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8057643
Oh, thank you for the points, grading and for the feedback :-)

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month11 days, 20 hours left to enroll

752 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