Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-03-2009, 10:03 AM   PM User | #1
ns74
New to the CF scene

 
Join Date: Mar 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
ns74 is an unknown quantity at this point
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
ns74 is offline   Reply With Quote
Old 03-03-2009, 10:40 AM   PM User | #2
Spudhead
Senior Coder

 
Spudhead's Avatar
 
Join Date: Jun 2002
Location: London, UK
Posts: 1,856
Thanks: 8
Thanked 110 Times in 109 Posts
Spudhead is on a distinguished road
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.
Spudhead is offline   Reply With Quote
Old 03-03-2009, 01:17 PM   PM User | #3
ns74
New to the CF scene

 
Join Date: Mar 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
ns74 is an unknown quantity at this point
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
ns74 is offline   Reply With Quote
Reply

Bookmarks

Tags
form, text, txt

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:34 PM.


Advertisement
Log in to turn off these ads.