...

View Full Version : help reading files to text fields



turkeyvalley
05-02-2004, 03:58 PM
here's my form: http://www.turkeyvalley.org/calendar.html
it submits the info to this file: http://www.turkeyvalley.org/calendar.html.txt

what i want to do is, whenever they click a date:
if that date has already had info submitted for it, it loads it into the text fields and the submit button remains disabled
if it doesn't, the text fields are left blank and the submit button is enabled

i was thinking you just read through the text file until you find the entry with the date in the text field, and fill in the rest of the fields
but i don't have any clue how to do it!
i've gotten this far on my own, can someone help me out with the last stretch?

*any help at all would be appreciated, the major thing being loading the file into a variable

sad69
05-03-2004, 06:12 PM
I don't think Javascript can read/write to files..

I dunno how this might work, but you could load the text file into an invisible textarea or maybe an invisible iFrame, and then look at it that way?

The reason I say that is because Javascript is typically client-side scripting, whereas this file is on the server. So if the server includes this file in HTML that the user is downloading, it's now on the client-side, so now Javascript can be used.

Just a thought..

Sadiq.

Roy Sinclair
05-03-2004, 06:31 PM
See the FAQ: http://www.codingforums.com/showthread.php?p=178912#post178912

(What you want to do is indeed possible, so start with the links in the FAQ).

turkeyvalley
05-03-2004, 11:59 PM
this will really help me getting started... i'm VERY knowledgeable in C++ but fairly new to java ... i'm sure the transition shuold be easy but i haven't done C since last june (in AP C++ Class LoL) but i'm sure i'll pick up on it quickly

hopefully i could have the "mini-database" done in a week or so

liorean
05-04-2004, 12:03 AM
Just a note:
Java and JavaScript are entirely different languages. Don't confise the two. This is JavaScript we're talking about.

turkeyvalley
05-04-2004, 12:34 AM
yea i got ya i was just shortening it up a bit ... thanx tho



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum