Skip to main content
Shop Support Downloads
IBM Home Products Consulting Industries News About IBM
IBM developerWorks : XML : Education - Tutorials
Tootomatic with Java 2 v1.4.2_05, and a Self-test feature
PDF (letter)PDF (A4)Javascript e-mail it pop-up
Main menuSection menuFeedbackPrevious
Next Section
3. Fixing the Problems

E-mail It Form Functionality - Using it page 6 of 6

Changes to emailfriend.js

The Javascript file creates a form tag with an action attribute's value containing the url of an IBM server file. This needs to be changed to point to a working file.

  • The form also uses the following inputs:
    • body - from the tutorial's abstract attribute
    • subject - from the tutorial's title element
    • url - from the tutorial's email-link attribute
    • email - from the form's Send to: input
    • fromName - from the form's Your name: input
    • fromEmail - from the form's Your e-mail address: input
    • comments - from the form's Comments: input

If the email server file in the form's action attribute does not handle multiple addressees the text should be changed to indicate such.


Modify the pop-up's text by changing the output variable here:

output += "<td colspan='2'><font FACE='HELVETICA, HELV, ARIAL' SIZE='-1'>Share this developerWorks content with others who you think will find it interesting, useful, or even amusing. Be sure to separate multiple e-mail addresses with a comma.</font><br /><br /></td>";

Add scrollbars to the pop-up:

emailWindow ="","subwindow","HEIGHT=500,WIDTH=600,resizable=yes,scrollbars=yes");

Provide clues indicating the use of Javascript and the pop-up by changing the alt attribute in the dw-style.xsl file:

<a border="0" href="javascript:newWindow()">
<img src="../{$images-directory}/i/icon-email.gif" border="0" alt="Javascript e-mail it pop-up"/>

Next Section
Main menuSection menuFeedbackPrevious
About IBM | Privacy | Legal | Contact