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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    form that displays a .txt file

    Hi, I am an italian boy, so I apologize for my english.

    I have this problem:
    I want to do a html page with a form that display some text that is in a file .txt.
    So when I want to change the text displaied in the form, I can change the test in the file .txt.

    It is possible to make this in javascript or I have to ask to another forum or another application?
    (I wouldn't use a asp page)

    Thank in advance...e sorry for my english.

    SiNi

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    You can do this with AJAX. Here's how you could do it using the jQuery library, for example:

    Code:
    // when the page is ready
    $(document).ready(function(){
    
    	// fetch the text file
    	$.get("myTextFile.txt", function(data){
    
    		// when the text file is loaded, put its content into an element on the page.
    		$('#myFormElement').text(data);
    
    	});
    
    });
    You'll need to include the jQuery JS file on your page.

  • #3
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I thank you very much.

    Could I ask you a favour?
    Could you make me an example with a form?
    I am new in html pages and I have not a great experience...

    I Thank you in advance.

    SiNi


  •  

    Tags for this Thread

    Posting Permissions

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