Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Javascript question ??

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Javascript question ??
 Login/Join
 
Guru
posted
Okay, I hope this is an easy one for someone. I have been scouring the forum for an answer
and have not found one. I need to pass 4 parameters to an in line HTML form that will
populate an email form. I can only get the form to accept the first parameter(bcc).
I think that I don't have the code right in the Style Type to pass all of the parameters.
I have commented out some of my attempts that didn't work. Can someone please help ?
Thanks much


-* File acceptance_letter_manual_email.fex

DEFINE FILE MAALEMAIL_DATA
NEW_LINE/I3=
IF ARGLEN(2500, MAALEMAIL_DATA.SEG01.BCC, 'I5') GT 2450
THEN NEW_LINE + 1;
LINK_TEXT/A50V='CLICK HERE TO GENERATE EMAIL'|NEW_LINE;
from/A35V='KalamazooValleyCommunications';
subject/A50V='Welcome!  Important information you need to know.';
body/A2500V='This is a test';
END

  
TABLE FILE MAALEMAIL_DATA
SUM 
     MAALEMAIL_DATA.SEG01.LINK_TEXT AS ''
     MAALEMAIL_DATA.SEG01.BCC AS 'bcc'
     from 
     subject 
     body 
BY  MAALEMAIL_DATA.SEG01.NEW_LINE NOPRINT
ON TABLE SET PAGE-NUM OFF 
ON TABLE NOTOTAL
ON TABLE HOLD AS JAVATEMP FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
$
TYPE=REPORT,
     GRID=OFF,
$
TYPE=DATA,
     COLUMN=N2,
     COLOR='BLACK',
     JAVASCRIPT=showitem( bcc ), 
-*Attempts that didn't work ********************************************************
-*   JAVASCRIPT=showitem( bcc from subject body ), 
-*   JAVASCRIPT=showitem( bcc , from ,subject , body ),
-*   JAVASCRIPT=showitem( bcc \ from \ subject \ body ),
-*	 JAVASCRIPT=showitem( \ bcc \ ),   
-*	 JAVASCRIPT=showitem( \ from \ ),
-*	 JAVASCRIPT=showitem( \ subject \ ),
-*	 JAVASCRIPT=showitem( \ body    \ ),
-*******************************************************************************
$
ENDSTYLE
END
-RUN

-*-IF &LINES EQ 0 THEN GOTO NO_RECS
-*-ELSE GOTO KEEP_GOING;
 

-KEEP_GOING


-HTMLFORM BEGIN
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
// This function will display the value in the text box
 
function doRegex(theType,theExp,theString,theReplace){if(theType=='m'){var re=new RegExp(theExp);var m=theString.match(re);if(m==null){return false}else{if(m[1]==null){return 1}else{return m[1]}}}if(theType=='s'){var re=new RegExp(theExp,"g");var res=theString.replace(re,theReplace);return(res);}alert('unknown regex type [m,s]: '+theType)}
 
function showitem(string1, string2, string3, string4) {
document.emailform.bcc.value = string1;
document.emailform.from.value = string2;
document.emailform.subject.value = string3;
document.emailform.body.value = string4;
document.emailform.submit();
}

 
function init(){
var thelinks=document.getElementsByTagName("a");
var theUltimateData = "";
 for (var i=0;i<thelinks.length;i++){
//   alert(thelinks[i].href );
   if(doRegex('m','^javascript:showitem',thelinks[i].href )) {
//   alert(thelinks[i].href );
 theData=doRegex('s','javascript:showitem\\(\'',thelinks[i].href,'');
//   alert(theData);
 theData=doRegex('s',',\'\\);',theData, '' );
 theUltimateData = theUltimateData + ', '+ theData; 
  }
  document.emailform.bcc.value = theUltimateData;
    }
 document.emailform.submit();
}
// End the hiding here

</SCRIPT>
</HEAD>
<BODY onload="init();">
<BODY onload="showitem(string1, string2, string3, string4);">
!IBI.FIL.JAVATEMP;
<HR>
<FORM NAME="emailform" method="post" action="https://www.kvcc.edu/form2mail_notemplate.php">
<INPUT TYPE="HIDDEN" NAME="bcc" value="">
<INPUT TYPE="HIDDEN" NAME="from" value="">
<INPUT TYPE="HIDDEN" NAME="subject" value="">
<INPUT TYPE="HIDDEN" NAME="body" value="">
<INPUT TYPE="HIDDEN" NAME="as" value="0" >
<INPUT TYPE="HIDDEN" NAME="to" value="{lou}">
 
 
<INPUT NAME="B1" TYPE=SUBMIT VALUE="HITME">
 
</FORM>
</BODY>
</HTML>
 
-HTMLFORM END

-GOTO FINISHED;


-NO_RECS

//Catches errors-if 'Send Email' button is pushed when there is no record(no email address to send to)
-HTMLFORM BEGIN
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">

function init(){
alert('There is no recipient email address.');
}


</SCRIPT>
</HEAD>
<BODY onload="init();">
!IBI.FIL.JAVATEMP;
<HR>

-HTMLFORM END

-FINISHED



This message has been edited. Last edited by: Kerry,


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
 
Posts: 272 | Location: Kalamazoo, Michigan | Registered: September 30, 2010Report This Post
Virtuoso
posted Hide Post
See code below for style sheet declaration passing more than one parameter to JavaScript:

TABLE FILE CAR
PRINT 
     CAR.CARREC.MODEL
     CAR.BODY.SEATS
BY  LOWEST CAR.ORIGIN.COUNTRY
BY  LOWEST CAR.COMP.CAR
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE HOLD AS HRESULT FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
TYPE=REPORT,
     FONT='ARIAL',
$
TYPE=DATA,
     COLUMN=N2,
     JAVASCRIPT=driveme( \
     N1 \
     N2 \
     ),
$
ENDSTYLE
END
-RUN

-HTMLFORM BEGIN
<html>
<head>
   <script type="text/javascript">
      function driveme (country, car) {
         alert("It's nice driving a " + car + " along " + country + "!");
      }
   </script>
   <title>JavaScript Drilldown</title>
</head>
<body>
   !IBI.FIL.HRESULT;
</body>
</html>
-HTMLFORM END



That combination falls somewhere between attempts #3 and #4 in the ones that "didn't work" in your code. Wink



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Guru
posted Hide Post
Thank you njsden! I'll give it a try.


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
 
Posts: 272 | Location: Kalamazoo, Michigan | Registered: September 30, 2010Report This Post
Guru
posted Hide Post
Unfortunately that didn't work...


TYPE=DATA,
     COLUMN=N2,
     COLOR='BLACK',
     JAVASCRIPT=showitem( \ 
	 N3 \
	 N4 \
	 N5 \
	 N6 \
	  ), 



WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
 
Posts: 272 | Location: Kalamazoo, Michigan | Registered: September 30, 2010Report This Post
Virtuoso
posted Hide Post
Oh, that's very unfortunate.


Did you try running the code I pasted as-is? You should be able to run it as it's all self-contained and relies on the CAR table. At least you can discard any issues with the Style Sheet declaration ... you could perhaps stick the showitem() function in it and test it with CAR data to see what it's receiving ...



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Guru
posted Hide Post
I haven't run your code yet, but I will. I looked at the html page source code and it looks like it isn't getting anything for the other parameters, only the bcc.


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
 
Posts: 272 | Location: Kalamazoo, Michigan | Registered: September 30, 2010Report This Post
Guru
posted Hide Post
Your CAR code works.


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
 
Posts: 272 | Location: Kalamazoo, Michigan | Registered: September 30, 2010Report This Post
Guru
posted Hide Post
But my code still does not work.


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
 
Posts: 272 | Location: Kalamazoo, Michigan | Registered: September 30, 2010Report This Post
Virtuoso
posted Hide Post
DEFINE FILE CAR
bcc/A35 WITH CAR=COUNTRY;
from/A35V WITH CAR='KalamazooValleyCommunications';
subject/A50V WITH CAR='Welcome!  Important information you need to know.';
body/A2500V WITH CAR='This is a test';
END

  
TABLE FILE CAR
SUM 
     bcc
     from 
     subject 
     body 
BY  COUNTRY NOPRINT
ON TABLE SET PAGE-NUM OFF 
ON TABLE NOTOTAL
-*ON TABLE HOLD AS JAVATEMP FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT,
     GRID=OFF,
$
TYPE=DATA,
     COLUMN=N2,
     COLOR='BLACK',
     JAVASCRIPT=showitem( \
      bcc \
      from \
      subject \
      body \
      ), 
$
ENDSTYLE
END
-RUN



When hovering over the hyperlinks, you can see that each JavaScript call is complete (as shown in the browser's status bar).

Perhaps those doRexExp transformations you're doing in the init() function are somehow breaking the original function calls created by WebFOCUS?

Or ... something in MAALEMAIL_DATA.SEG01.BCC could be messing up the results?

I don't know ... it's a bit hard to guess without knowing the values you're dealing with.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Guru
posted Hide Post
I think you are right, I am looking into the reg expression. I am just passing an email address with the MAALEMAIL_DATA.SEG01.BCC, and I'm getting that but if I move 'from' to the first parameter in
 TYPE=DATA,
     COLUMN=N2,
     COLOR='BLACK',
     JAVASCRIPT=showitem( \
      from \
      bcc\
      subject \
      body \
      ), 

then I get the from only. This has to populate a pre-made email form the college uses.
Thanks for the help, I'll keep working on it.


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
 
Posts: 272 | Location: Kalamazoo, Michigan | Registered: September 30, 2010Report This Post
Virtuoso
posted Hide Post
Firstly, you have two BODY open-tags. Don't do that.

Secondly, BODY onload disables the code that IBI runs on load. Your onload code should go in a function called onInitialUpdate():
function onInitialUpdate() {
    init();
    showitem(string1, string2, string3, string4);
}


Those 4 strings and the showitem() function are never defined in your code either.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Guru
posted Hide Post
Wep5622, I have modified the code to what I
think you are talking about, but it still does
not work. The values for the strings come from
the Javascript=showitem call in the Type=Data
part of the report style. I took out the
doRegex call all together because I don't see
why it would be needed. That was for
processing multiple bcc addresses and I am only
passing one address in this report.


DEFINE FILE MAALEMAIL_DATA
NEW_LINE/I3=
IF ARGLEN(2500, MAALEMAIL_DATA.SEG01.BCC, 'I5') GT 2450
THEN NEW_LINE + 1;
LINK_TEXT/A50V='CLICK HERE TO GENERATE EMAIL'|NEW_LINE;
from/A35V='KalamazooValleyCommunications';
subject/A50V='Welcome!  Important information you need to know.';
body/A2500V='This is a test';
END
 
  
TABLE FILE MAALEMAIL_DATA
SUM 
     MAALEMAIL_DATA.SEG01.LINK_TEXT AS ''
     from 
	 subject 
     body 
BY  MAALEMAIL_DATA.SEG01.BCC AS 'bcc'
ON TABLE SET PAGE-NUM OFF 
ON TABLE NOTOTAL
ON TABLE HOLD AS JAVATEMP FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
$
TYPE=REPORT,
     GRID=OFF,
$
TYPE=DATA,
     COLUMN=N1,
     COLOR='BLACK',
     JAVASCRIPT=showitem( \ 
	 N1 \
	 N3 \
	 N4 \
	 N5 \
	  ), 
$  
ENDSTYLE
END
-RUN
  
-KEEP_GOING
 
 
-HTMLFORM BEGIN
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
// This function will display the value in the text box
 
//function doRegex(theType,theExp,theString,theReplace){if(theType=='m'){var re=new RegExp(theExp);var m=theString.match(re);if(m==null){return false}else{if(m[1]==null){return 1}else{return m[1]}}}if(theType=='s'){var re=new RegExp(theExp,"g");var res=theString.replace(re,theReplace);return(res);}alert('unknown regex type [m,s]: '+theType)}
 
function showitem(String1 String2 String3 String4) {
document.emailform.bcc.value = String1;
document.emailform.from.value = String2;
document.emailform.subject.value = String3;
document.emailform.body.value = String4;
document.emailform.submit();
}

function onInitialUpdate(){
function showitem(String1, String2, String3, String4);
}
// End the hiding here
 
</SCRIPT>
</HEAD>
<BODY onload="onInitialUpdate();">
!IBI.FIL.JAVATEMP;
<HR>
<FORM NAME="emailform" method="post" action="https://www.kvcc.edu/form2mail_notemplate.php">
<INPUT TYPE="HIDDEN" NAME="bcc" value="">
<INPUT TYPE="HIDDEN" NAME="from" value="">
<INPUT TYPE="HIDDEN" NAME="subject" value="">
<INPUT TYPE="HIDDEN" NAME="body" value="">
<INPUT TYPE="HIDDEN" NAME="as" value="0" >
<INPUT TYPE="HIDDEN" NAME="to" value="{lou}">
 
 
<INPUT NAME="B1" TYPE=SUBMIT VALUE="HITME">
 
</FORM>
</BODY>
</HTML> 
-HTMLFORM END


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
 
Posts: 272 | Location: Kalamazoo, Michigan | Registered: September 30, 2010Report This Post
Virtuoso
posted Hide Post
First clean up your code.

NEW_LINE/I3=
IF ARGLEN(2500, MAALEMAIL_DATA.SEG01.BCC, 'I5') GT 2450
THEN NEW_LINE + 1;

1. Never code "= IF" without an explicit "ELSE".

LINK_TEXT/A50V='CLICK HERE TO GENERATE EMAIL'|NEW_LINE;

2. NEW_LINE is numeric, catenation (|) requires both sides to be alpha. (For some some reason, the catenation is simply ignored w/o warning, but why tempt fate?)

function showitem(String1 String2 String3 String4) {

3. missing commas between the formal arguments.

This message has been edited. Last edited by: j.gross,


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Virtuoso
posted Hide Post
I took your code and modified it slightly to see if the variables did get processed correctly.
They are. So, the problem is not with the code you provided (that is, if you take Jack's comments into account), but it must be in the communication between your code and the link you use.
This code works fine:
APP FI EMAIL_DATA DISK email_data.txt
APP FI OUT DISK email_data.mas
-RUN

-WRITE OUT FILENAME=EMAIL_DATA, SUFFIX=FIX, $
-WRITE OUT FIELD=BCC , USAGE=A40, ACTUAL=A40, $
-WRITE EMAIL_DATA email_address@one.com
-WRITE EMAIL_DATA email_address@two.com
-WRITE EMAIL_DATA email_address@three.com
-WRITE EMAIL_DATA email_address@four.com

DEFINE FILE EMAIL_DATA
NEW_LINE/I3    = IF ARGLEN(2500, BCC, 'I5') GT 2450 THEN NEW_LINE + 1 ELSE NEW_LINE;
LINK_TEXT/A50V = 'CLICK HERE TO GENERATE EMAIL ' | EDIT(NEW_LINE);
from/A35V      = 'KalamazooValleyCommunications';
subject/A50V   = 'Welcome!  Important information you need to know.';
body/A2500V    = 'This is a test';
END
 
TABLE FILE EMAIL_DATA
SUM   LINK_TEXT from subject body
BY    BCC AS 'bcc'
ON TABLE HOLD AS JAVATEMP FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
TYPE=DATA, COLUMN=N1, COLOR='BLACK',
     JAVASCRIPT=showitem( BCC from subject body ), $  
ENDSTYLE
END
-RUN

-HTMLFORM BEGIN
<html>
<head>
<script language="JavaScript">
// This function will display the value in the text box
function showitem(String1, String2, String3, String4) {
document.emailform.bcc.value = String1;
document.emailform.from.value = String2;
document.emailform.subject.value = String3;
document.emailform.body.value = String4;
document.emailform.submit();
}
// End the hiding here
</script>
</head>
<body>
!IBI.FIL.JAVATEMP;
<hr>
<form name="emailform" method="post" action="/ibi_apps/WFServlet">
<input name="IBIAPP_app"       type=hidden value="session baseapp">
<input name="IBIF_ex"          type=hidden value="testemail.fex">
<input type="hidden" name="bcc" value="">
<input type="hidden" name="from" value="">
<input type="hidden" name="subject" value="">
<input type="hidden" name="body" value="">
<input type="hidden" name="as" value="0" >
<input type="hidden" name="to" value="{lou}">
</form>
</body>
</html> 
-HTMLFORM END
The referenced focexec testemail.fex just contains the line '-? &' which shows all variables available. In that list you'll see all variables specified listed correctly.
So it must have something to do with how https://www.kvcc.edu/form2mail_notemplate.php expects its prarameters.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Guru
posted Hide Post
J-Gross and GAMP, Thank you so much for the direction. I am going to test your advise today. I'll let you know how it goes.

This message has been edited. Last edited by: MAdams1,


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
 
Posts: 272 | Location: Kalamazoo, Michigan | Registered: September 30, 2010Report This Post
Guru
posted Hide Post
Ok GamP, taking your code and using my data this is what I came up with, however,
I get the email form but everything I am trying to pass is undefined. What am I missing?
Can you explain how the data is suppose to get from the Table Request to the form?
I commented out a BODY tag that I added thinking it would call the showitem function but I kept getting an error that String1 is
not defined. Thank you for your help, I think we're close.

-* File testemail.fex
-*APP FI EMAIL_DATA DISK email_data.txt
-*APP FI OUT DISK email_data.mas
-*-RUN
-* 
-*-WRITE OUT FILENAME=EMAIL_DATA, SUFFIX=FIX, $
-*-WRITE OUT FIELD=BCC , USAGE=A40, ACTUAL=A40, $
-*-WRITE EMAIL_DATA email_address@one.com
-*-WRITE EMAIL_DATA email_address@two.com
-*-WRITE EMAIL_DATA email_address@three.com
-*-WRITE EMAIL_DATA email_address@four.com
 
DEFINE FILE MAALEMAIL_DATA
NEW_LINE/I3    = IF ARGLEN(2500, BCC, 'I5') GT 2450 THEN NEW_LINE + 1 ELSE NEW_LINE;
LINK_TEXT/A50V = 'CLICK HERE TO GENERATE EMAIL ' | EDIT(NEW_LINE);
from/A35V      = 'KalamazooValleyCommunications';
subject/A50V   = 'Welcome!  Important information you need to know.';
body/A2500V    = 'This is a test';
END
 
TABLE FILE MAALEMAIL_DATA
SUM   LINK_TEXT from subject body
BY    BCC AS 'bcc'
ON TABLE HOLD AS JAVATEMP FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
TYPE=DATA, COLUMN=N1, COLOR='BLACK',
     JAVASCRIPT=showitem( BCC from subject body ), $  
ENDSTYLE
END
-RUN


-HTMLFORM BEGIN
<html>
<head>
<script language="JavaScript">
// This function will display the value in the text box
function showitem(String1, String2, String3, String4) {
document.emailform.bcc.value = String1;
document.emailform.from.value = String2;
document.emailform.subject.value = String3;
document.emailform.body.value = String4;
document.emailform.submit();
}
// End the hiding here
</script>
</head>
//<BODY onload="showitem();">
//!IBI.FIL.JAVATEMP;
<body>
!IBI.FIL.JAVATEMP;
<hr>
<form name="emailform" method="post" action="https://www.kvcc.edu/form2mail_notemplate_noauth.php?skiptemplate=1">
-*<input name="IBIAPP_app"       type=hidden value="session baseapp">
-*<input name="IBIF_ex"          type=hidden value="testemail.fex">
<input type="hidden" name="bcc" value="">
<input type="hidden" name="from" value="">
<input type="hidden" name="subject" value="">
<input type="hidden" name="body" value="">
<input type="hidden" name="as" value="0" >
<input type="hidden" name="rand" value="53265533563213246543107" >
<input type="hidden" name="to" value="{lou}">
</form>
</body>
</html> 
-HTMLFORM END


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
 
Posts: 272 | Location: Kalamazoo, Michigan | Registered: September 30, 2010Report This Post
Guru
posted Hide Post
I would put a screen shot of the email form that says undefined for everything, if I knew how to do that.


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
 
Posts: 272 | Location: Kalamazoo, Michigan | Registered: September 30, 2010Report This Post
Guru
posted Hide Post
Okay, I got it to fill in the email form with the correct information....Yay! Only thing it doesn't do is bring up the form w/o clicking the link(LINK TEXT). I wonder if this will be solved with as=1 ? Thank you so much!!

 
-* File testemail.fex
-*APP FI EMAIL_DATA DISK email_data.txt
-*APP FI OUT DISK email_data.mas
-*-RUN
-* 
-*-WRITE OUT FILENAME=EMAIL_DATA, SUFFIX=FIX, $
-*-WRITE OUT FIELD=BCC , USAGE=A40, ACTUAL=A40, $
-*-WRITE EMAIL_DATA email_address@one.com
-*-WRITE EMAIL_DATA email_address@two.com
-*-WRITE EMAIL_DATA email_address@three.com
-*-WRITE EMAIL_DATA email_address@four.com
 
DEFINE FILE MAALEMAIL_DATA
NEW_LINE/I3    = IF ARGLEN(2500, BCC, 'I5') GT 2450 THEN NEW_LINE + 1 ELSE NEW_LINE;
LINK_TEXT/A50V = 'CLICK HERE TO GENERATE EMAIL ' | EDIT(NEW_LINE);
from/A35V      = 'KalamazooValleyCommunications';
subject/A50V   = 'Welcome!  Important information you need to know.';
body/A2500V    = 'This is a test';
END
 
TABLE FILE MAALEMAIL_DATA
SUM   LINK_TEXT 
	  BCC AS 'bcc'
 	  from 
	  subject 
	  body     
ON TABLE HOLD AS JAVATEMP FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
TYPE=DATA, COLUMN=N1, COLOR='BLACK',
     JAVASCRIPT=showitem( BCC from subject body ), $  
ENDSTYLE
END
-RUN


-HTMLFORM BEGIN
<html>
<head>
<script language="JavaScript">
// This function will display the value in the text box
function showitem(String1, String2, String3, String4) {
document.emailform.bcc.value = String1;
document.emailform.from.value = String2;
document.emailform.subject.value = String3;
document.emailform.body.value = String4;
document.emailform.submit();
}
// End the hiding here
</script>
</head>
<BODY onload="showitem(String1, String2, String3, String4);">
!IBI.FIL.JAVATEMP;
<hr>
<form name="emailform" method="post" action="https://www.kvcc.edu/form2mail_notemplate_noauth.php?special code here that makes it work">
<input type="hidden" name="bcc" value="">
<input type="hidden" name="from" value="">
<input type="hidden" name="subject" value="">
<input type="hidden" name="body" value="">
<input type="hidden" name="as" value="0" >
<input type="hidden" name="rand" value="53265533563213246543107" >
<input type="hidden" name="to" value="{lou}">


</form>
</body>
</html> 
-HTMLFORM END

 

This message has been edited. Last edited by: MAdams1,


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
 
Posts: 272 | Location: Kalamazoo, Michigan | Registered: September 30, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Javascript question ??

Copyright © 1996-2020 Information Builders