Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    May 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help reading files to text fields

    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

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    See the FAQ: http://www.codingforums.com/showthre...912#post178912

    (What you want to do is indeed possible, so start with the links in the FAQ).
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #4
    New to the CF scene
    Join Date
    May 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thanx both of you

    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

  • #5
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Just a note:
    Java and JavaScript are entirely different languages. Don't confise the two. This is JavaScript we're talking about.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #6
    New to the CF scene
    Join Date
    May 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yea i got ya i was just shortening it up a bit ... thanx tho


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •