eBook authors eBook Software - create and publish your own ebooks
Create your own eBooks
 
   
EBookApprentice.com
Learn How To Create, Publish & Market E-Books
 
   
EBookCompiler.com
E-Book Creation Software
 
   
EBookPower.com
Add sophisticated multimedia to your E-Books
 
   
CoverFactory.com
Create E-Book covers in minutes
 
 
  EBookSubmit.com
E-Book Marketing & Promotion made easy
 
  EBookJungle.com
Search engine for E-Books
 
  EBookInterviews.com
Interviews with eBook authors
 
  EBookEnhance.com
Tools for building better eBooks
 
 
 
Archived Message:

Populate a form from a file


 
Carlos I saved a file (userinfo.txt) with the following info:
- First Name
- Last Name
- Address
- Country
- e-mail

If I want to retrieve that info to populate a form is the following way correct?
1. Get the contents by using the FILEREAD
2. Split the contents by using the linefeed/return as a delimiter and populate an array
3. Populate the form

Is there other ways to do this?
I didn't found any example in this forum with step-by-step info on how to retrieve info from a file and populate a form with several fields.


Thanks,
Carlos


Posted on: 8:44 am on January 26, 2003
Alaska Carlos -

Send me an address, I'll send you a demo.

 Such a deal, yes?

best -
roger
rnilsson@copperfieldpub.com

(Edited by Alaska at 3:22 pm on Jan. 26, 2003)


Posted on: 12:21 pm on January 26, 2003
KC *

(Edited by KC at 3:23 am on June 8, 2003)


Posted on: 1:51 pm on January 26, 2003
NymRod This is the info I'm looking for, to bad it's not here. (

Posted on: 5:15 am on March 27, 2003
KC *

(Edited by KC at 3:22 am on June 8, 2003)


Posted on: 9:29 am on March 27, 2003
NymRod So the readfile.as is going to be like a remote JS file?

That looks like a lot of work.
I have 3 forms with a total of 290 form elements including text fields, checkboxes, radio buttons and drop-down menus.

Will that save the status of checkboxes, radio buttons and the drop-down menu selections?

I've been using a form saver cookie to save the data, it works fine until the amount of data being saved exceeds the limits of the cookie string then it no longer repopulates the fields.

Maybe I should start a new topic to explain about what I'm attempting to do.


Thanks

NymRod


Posted on: 10:45 am on March 27, 2003
KC *

(Edited by KC at 3:23 am on June 8, 2003)


Posted on: 11:38 am on March 27, 2003
april thunder Hi there! I've got this same problem. I've been trying to use the FILEREAD command, but I can't seem to get it to grab information from multiple lines in the same file. The instructions in the Activ Compiler's help file are pretty good, but they don't exactly show how these commands are supposed to work together.

(For example, in the FILEWRITE command, it show's this particular command's syntax, but nowhere does it say in the Help file that you need the RETURN and LINEFEED commands to help you to go down to the next lower line. While RETURN and LINEFEED are discussed individually, they aren't shown in conjunction with FILEWRITE.

I'm using Sunil's FILEWRITE example code to write the info to a file, and I'm now trying to do the reverse: Reading this data back into Activ variables, and repopulating the orginal data fields. (I've pasted the FILEWRITE code below this message).

I'd really appreciate help regarding this matter.

Best regards to all,

- April Thunder

------- The FILEWRITE sample code ---------------
 
<HTML>
<HEAD>
<TITLE>Test</TITLE>
</HEAD>
<BODY>
<FORM METHOD="POST" ACTION="#!writefile.as">
Name<BR>
<INPUT TYPE="TEXT" NAME="fname" SIZE=32>
<BR><BR>
Address 1<BR>
<INPUT TYPE="TEXT" NAME="faddress1" SIZE=32>
<BR><BR>
Address 2<BR>
<INPUT TYPE="TEXT" NAME="faddress2" SIZE=32>
<BR><BR>
City<BR>
<INPUT TYPE="TEXT" NAME="fcity" SIZE=32>
<BR><BR>
State<BR>
<INPUT TYPE="TEXT" NAME="fstate" SIZE=2>
<BR><BR>
ZIP<BR>
<INPUT TYPE="TEXT" NAME="fzip" SIZE=10>

<BR><BR>
<INPUT TYPE="SUBMIT" VALUE=" OK ">
</FORM>
</BODY>
</HTML>

writefile.as

REM next line necessary for 4.20 (see note in README)
SET('bok',0)

REM retrieve fields from form in Activ Variables of same name
FSET('fname','fname')
FSET('faddress1','faddress1')
FSET('faddress2','faddress2')
FSET('fcity','fcity')
FSET('fstate','fstate')
FSET('fzip','fzip')

REM build a long string of the text
SET('longstr','{fname}{return}{linefeed}')
SET('longstr','{longstr}{faddress1}{return}{linefeed}')
SET('longstr','{longstr}{faddress2}{return}{linefeed}')
SET('longstr','{longstr}{fcity}{return}{linefeed}')
SET('longstr','{longstr}{fstate}{return}{linefeed}')
SET('longstr','{longstr}{fzip}{return}{linefeed}')

REM prompt for file name
FILESAVEPROMPT('bsave','filepath','Save Address Info','','')
IF({bsave})
     FILEWRITE('bok','{filepath}','{longstr}')
     MESSAGEBOX('bok is {bok}')
     IF({bok})
             MESSAGEBOX('File saved okay')        
     ELSE
             MESSAGEBOX('File save error')        
     ENDIF
ELSE
      MESSAGEBOX('The address was not saved')
ENDIF
---------------------------------------------------------------


Posted on: 1:05 am on September 25, 2006

Go to Active Discussion Thread

Participate in Current/New Discussions

List All Archived Forums



Copyright © 2000-2015, Answers 2000 Limited.

With any business, it is up to the individual owner of said business to ensure the success of the business. You may make more or less than any sample figures or results that might be quoted on our web sites or other publications. All business involves risk, and many businesses do not succeed. Further, Answers 2000 Limited does NOT represent that any particular individual or business is typical, or that any results or experiences achieved by any particular individual/business is necessarily typical.

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.

Contact Us    About and Terms Of Use    Privacy    Advertising/Endorsements Disclosures