eBook Scripts
a form that remembers

 

A form that remembers

Overview

This script demonstrates how to remember user input to a form, and display back.


Requirements
Instructions
  1. First you need to create an HTML page that links to the form. In this example, I have created a minimal page, the important line being the one that begins <A HREF=...

  2. Next you need to create the HTML code that goes above and below the FORM (the top and bottom of the page). The easiest way to do this is to create 2 files (using say Notepad) outside the source folder (say in the include folder) contain this code. Then add 2 Activ variables, both of type Compile Time Include HTML Fragment called say top and bot, and then select the corresponding files.

    Here's what I put in the file used for the top variable:
    Here's what I put in the file used for the bot variable:
  3. The next step is to create a script to display the form. In my example, this script is called showform.as. You can create this using Notepad or any other plain text editor.

    Please note: If using Notepad on a version of Windows prior to Windows XP, when you save in Notepad, be sure to place the file name in quotes on the Save As dialog box, i.e. "showform.as" otherwise Notepad will add .txt to the end of the name (giving a file name of showform.as.txt). If using Notepad on Windows XP, this workaround is not necessary.

    My script will read the value to display in the form field from an INI file called myform.ini (you can and should change that), then generate the form page using the top and bot variables that I made earlier, plus the form itself inserted in between.

    Here is my showform.as file (the lines beginning with REM are comments explaining what the script does):

  4. The last part is to create the script that is run when the form is submitted.

    If you look carefully at the previous step, you'll see that the form is linked to a script called doform.as.

    So here is my doform.as script (again, create this with a plain text editor and place in your source folder along with the HTML files).

    Please note: If using Notepad on a version of Windows prior to Windows XP, when you save in Notepad, be sure to place the file name in quotes on the Save As dialog box, i.e. "doform.as" otherwise Notepad will add .txt to the end of the name (giving a file name of doform.as.txt). If using Notepad on Windows XP, this workaround is not necessary.


Notes
  1. This script has been tested with Activ E-Book Compiler versions 4.20, 4.21 and 4.22 (4.22 is the latest version at the time of writing). It is possible that changes might be required for e-books made with subsequent versions.

  2. This script will not work with versions of Activ E-Book Compiler prior to 4.20.






 

Home: eBook Code
Design Tips
Scripts
Templates/Translations



Other Sites about eBooks

EBookApprentice.com
Learn about eBook publishing

EBookCompiler.com
Software to create your own eBooks

CoverFactory.com
Create eBook Covers with ease

EBookPower.com
Add multimedia to your eBooks

EBookFriends.com
Discuss eBooks

EBookInterviews.com
Read about other eBook authors' experiences

EBookSubmit.com
Learn about eBook marketing

EBookJungle.com
Searchable directory of eBooks



Related Links

Affiliate Programs
Affiliate Marketing Downloads
Affiliate Marketing eBooks
Affiliate Program Reviews

eBook Authoring
eBook Authoring Downloads
eBooks for eBook Authors
eBook Compiler Software
eBook Cover Creation
eBook Cover Software

Marketing
Ezine Guide
Increase Website Traffic
Internet Marketing Guide
Internet Marketing Help
Press Release Guide

Search Engines
SEO Guide
SEO Tools

Your Site
Adobe Dreamweaver
Adobe Dreamweaver Tutorials
Accept Credit Cards
Domain Names
Web Design eBooks
Web Design Tools
Web Hosting
Web Hosting Directory
Webmaster Tools Directory

 

   
Disclosure: Advertising Link(s): Our company may receive a payment if you purchase a product/service after following this link.

Disclosure: Our company's websites' content (including this website's content) includes advertisements for our own company's websites, products, and services, and for other organization's websites, products, and services. In the case of links to other organization's websites, our company may receive a payment, (1) if you purchase products or services, or (2) if you sign-up for third party offers, after following links from this website. Unless specifically otherwise stated, information about other organization's products and services, is based on information provided by that organization, the product/service vendor, and/or publicly available information - and should not be taken to mean that we have used the product/service in question. Additionally, our company's websites contain some adverts which we are paid to display, but whose content is not selected by us, such as Google AdSense ads. For more detailed information, please see Advertising/Endorsements Disclosures

Our sites use cookies, some of which may already be set on your computer. Use of our site constitutes consent for this. For details, please see Privacy.

In Association With Amazon.com
Answers 2000 Limited is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com.
In Association With Amazon.co.uk
Answers 2000 Limited is a participant in the Amazon EU Associates Programme, an affiliate advertising programme designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.co.uk.

Contact Us     About/Terms Of Use     Privacy     Site Map     Advertising/Endorsements Disclosures

Copyright © 2002-2015, Answers 2000 Limited