Jaziar
asked on
Can someone tell me why this does not work?
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('','','heig ht=120,wid th=200');
cw.moveTo(200,200);
cw.document.write('<html>< head><titl e>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].C omments.va lue=\'\';' +
'opener.document.forms[0]. CommentHis tory.value +=\'\\n\'+ '+
'opener.document.forms[0]. CommentPre fix.value+ '+
'document.forms[0].add_com ment_2.val ue;'+
'opener.document.forms[0]. RefreshBut ton.onclic k();window .close()"> '+
'<input type=button value=Cancel '+
'onClick="window.close()"> '+
'</form></body></html>');
cw.document.close();
Right now the box comes up and I can type in it - press ok and thats it nothing else happens.
cw=window.open('','','heig
cw.moveTo(200,200);
cw.document.write('<html><
'<body><form><h3>Please Enter Comment</h3>'+
'<input type=text name=add_comment_2><br>'+
'<input type=button value=OK '+
'onClick="opener.document.
'opener.document.forms[0].
'opener.document.forms[0].
'document.forms[0].add_com
'opener.document.forms[0].
'<input type=button value=Cancel '+
'onClick="window.close()">
'</form></body></html>');
cw.document.close();
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.
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.
ASKER
I did not see it until after I posted this question.
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.
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.
ASKER
Comments
CommentPrefix
CommentHistory
RefreshButton
Yes GenerateHtmlForAllFields is checked but
Treat documents contents as HTML is not checked.
CommentPrefix
CommentHistory
RefreshButton
Yes GenerateHtmlForAllFields is checked but
Treat documents contents as HTML is not checked.
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('','','heig ht=620,wid th=600,sta tus');
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('','','heig
I just recreated a new form with cut and pasted code from here and it works.
Please send me this database.
Please send me this database.
ASKER
I can not send the database - Company policies - All databases are confidental - Sorry
ASKER
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.
ASKER
error says error on page when I hit OK
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.
Tell me what error occurred.
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.
Ok, then the remote RefreshButton click failed.
Check again for correct spelling of html NAME of this button.
ASKER
'opener.document.forms[0]. RefreshBut ton.onclic k();window .close()"> '+ is null or not a object
The name of the button and the code match
The name of the button and the code match
ASKER
THis is the source code on the actual page -
return false;" HREF="">Add Web Comment</A></TD><TD><A HREF="" onClick="return _doClick('e8a50a3d91db5f3c 85256ccc00 65c980/$V5 ACTIONS/0. 52D2', this, null)" TARGET="_self">RefreshButt on</A></TD ></TR>
return false;" HREF="">Add Web Comment</A></TD><TD><A HREF="" onClick="return _doClick('e8a50a3d91db5f3c
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><bod y><form><h 3>Please Enter Comment</h3><input type=text name=add_comment_2><br><in put type=button value=OK onClick="opener.document.f orms[0].Co mments.val ue='';open er.documen t.forms[0] .CommentHi story.valu e+='\n'+op ener.docum ent.forms[ 0].Comment Prefix.val ue+documen t.forms[0] .add_comme nt_2.value ;opener.do cument.for ms[0].Refr eshButton. onclick(); window.clo se()"><inp ut type=button value=Cancel onClick="window.close()">< /form></bo dy></html>
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><bod
What do you mean with "actual page"?
Is this the parent Form where the AddComment button reside?
And your RefreshButton is NOT a button!
Is this the parent Form where the AddComment button reside?
And your RefreshButton is NOT a button!
ASKER
HEre is the popup source
<html><head><title>Add Comment</title></head><bod y><form><h 3>Please Enter Comment</h3><input type=text name=add_comment_2><br><in put type=button value=OK onClick="opener.document.f orms[0].Co mments.val ue='';open er.documen t.forms[0] .CommentHi story.valu e+='\n'+op ener.docum ent.forms[ 0].Comment Prefix.val ue+documen t.forms[0] .add_comme nt_2.value ;opener.do cument.for ms[0].Refr eshButton. onclick(); window.clo se()"><inp ut type=button value=Cancel onClick="window.close()">< /form></bo dy></html>
<html><head><title>Add Comment</title></head><bod
I have an idea: send me the complete text of html source of your web page.
You have my address? zvonko@mysite.de
You have my address? zvonko@mysite.de
ASKER
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
ASKER
I sent it
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('522e617550f08a96 c1256cdb00 6e1627/$Bo dy/0.646', this, null)">
So now you have to create a Button anywhere on the main Form and give it this @Formula:
@Command([ViewRefreshField s])
In the property dialog for this Button enter in the last tab labeled with <HTML> this options:
Name: RefreshButton
Style: display:none
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('522e617550f08a96
So now you have to create a Button anywhere on the main Form and give it this @Formula:
@Command([ViewRefreshField
In the property dialog for this Button enter in the last tab labeled with <HTML> this options:
Name: RefreshButton
Style: display:none
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.
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.
ASKER
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
ASKER
I can only create a Hotspot button - should it be hidden? or will they need to click it
ASKER
Should the comment button also be a real button and not a action tag?
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 :-)
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 :-)
ASKER
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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!!
Oh, thank you for the points, grading and for the feedback :-)
ASKER
add_comment_1 := @Prompt([OKCANCELEDIT]; "Add Comment"; "Please Enter Comment"; " ");
add_comment_2 := @Name([CN]; @UserName) + " " + @Text @Now) + @NewLine + add_comment_1;
@SetField("CommentHistory"
@SetField("Comments"; "");
Only the CommentHistory field shows all others are hidden.