Solved

How to put a notes field inside passthru html/javascript

Posted on 2000-03-03
17
397 Views
Last Modified: 2013-12-18
How can I do the following, where NOTESFIELD is an actual notes field and the rest of the line is passthru HTML?

<SCRIPT language="Javascript">
message = "NOTESFIELD";
if (message !="") {alert(message);...etc

I **DON'T** want to reference the field by assigning it as folows:
myVar = document.forms[0].NOTESFIELD.value
instead I want to just stick the physical field in the middle of the code.  I'm told it can be done, I've been given several different ways, none of which I can get to work.
0
Comment
Question by:snocross
[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
17 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 2581526
Hi

1. Create a field called JScript on the form and layout looks similar to this.

<Script Language="Javascript">
[JScript]
</Script>

2. Mark the above paragraph as passthru HTML

3. In the Default Value , use the JS as a formula
message := "NOTESFIELD";
@if(message!="";"alert('message')";"");

This should work a treat !


Good Luck
~Hemanth
0
 
LVL 5

Author Comment

by:snocross
ID: 2581604
Thanks for the example, however, I'm getting the error 'JScript is not defined'.  Maybe I did something wrong.

1) I created a notes field called JScript with the following default formula:

message := "NOTESFIELD";
@if(message!="";"alert('message')";"");

2) I placed the following passthru html directly on the form:

<Script Language="Javascript">
[JScript]
</Script>
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 2585387
Hi

Define the JScript a ComputedForDisplay field.

PS: [JScipt] denotes field JScript.

Good luck
~Hemanth
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 5

Author Comment

by:snocross
ID: 2592162
Adjusted points to 200
0
 
LVL 5

Author Comment

by:snocross
ID: 2592163
I think the problem is this line:

message := "NOTESFIELD";

This is setting a variable called 'message' to a text string of "NOTESFIELD".  Instead of setting the variable to a text string I want to set it to be another field on my form.  This syntax does not seem to work...  

0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 2594185
Hi

It should work, silly mistake...

message := "NOTESFIELD";
@if(message!="";"alert('" + message + "')";"");

Good Luck
~Hemanth

0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 2594192
Hi

Ignore previous comment, Take this

message := "NOTESFIELD";
@if(message!="";"alert('" + message + "')";"");

Good Luck
~Hemanth



0
 
LVL 5

Author Comment

by:snocross
ID: 2600844
It does not work.  It prompts me with the word 'NOTESFIELD' instead of referencing the value of NOTESFIELD which happens to be '1'.
0
 
LVL 5

Author Comment

by:snocross
ID: 2600969
I appreciate your help... please, to see what I'm trying to do can you click on the following URL and look at Figure7 and Figure8.  The part that does not work is the

message = "PopUpMessage"

where PopUpMessage is an actual field called PopUpMessage.  Do you see anything wrong with the example?

http://www.martinscott.com/Site/DesignLibrary.nsf/Papers/Have
0
 
LVL 5

Author Comment

by:snocross
ID: 2601183
The example you give works however it does not solve my problem.  It displays a text string on the screen but it does not seem to be displaying the actual contents of a field.  Please see my comment.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 2603086
Hi

Had a look at the page and here is my proposed solution,

In the Register button use this code
========
FIELD PopUpMessage := PopUpMessage;
Success := Success;

ISNULL := @If( @Trim(FLD)=""; @True; @False);

@If( ISNULL ; @Do(@Set("Success"; @False); @SetField( "PopUPMessage"; "alert(\'Invalid entry\')")); @Do(@Set("Success"; @True); @SetField( "PopUPMessage"; "")));

@Command([ViewRefreshFields]);

@If( Success; @Do(@PostedCommand([FileSave]); @Command([FileCloseWindow]));@Return(0))
================

The Passthru HTML of Javascript goes like this
==========
<SCRIPT language="JavaScript">
 [--PopUPMessage--];
</SCRIPT>
==========



Good Luck
~Hemanth

0
 
LVL 4

Expert Comment

by:martijnmulder
ID: 2604932
you could use a computed text which would contain something like:

"<SCRIPT language=\"Javascript\">    
function clicked(){
       message ="+NOTESFIELD+";
       alert(message);}
 </SCRIPT>"

obviously the document has to be saved before you can use the value....
0
 
LVL 5

Author Comment

by:snocross
ID: 2613584
Thank you for your proposed answer, it may work, however I need to know how to do it with passthrough HTML... my question is how to place a real notes field inside of a block of passthrough Javascript code.
0
 
LVL 5

Author Comment

by:snocross
ID: 2613599
Hemanth, in regards to your proposed solution:  I'm assuming in place of [--PopUpMessage--] I will replace with an actual field called PopUpMessage but do I leave the square brackets?  Do I format that line as the HTML STYLE?
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 200 total points
ID: 2618490
Hi Snocross

Replace [--PopUpMessage--] with field , no square bkts. Mark the script block including the field as Passthru HTML or HTML Style.

~Hemanth
0
 
LVL 5

Author Comment

by:snocross
ID: 2619682
Thank you for your time with this problem.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 2621027
Anytime.

~Hemanth
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Email relaying to outside address 4 185
Fax server not receiving SMTP from Lotus Notes 6 402
Lotus Notes Calendar Issue 5 119
Options for Signing Database Design with Server ID 6 22
  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…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 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