|
| |
|
|
SerenityNet
Posts: 1372 Joined: 6/12/2001 From: Allen, TX, USA Status: offline
|
textarea initial text - 5/19/2004 1:15:24
Can I default the initial text of a textarea to the content of an htm file? When I post the form, can I replace the content of that same htm file? Can I do it without asp? If so, then either way (with or without asp), can you give me an example? Thanks, Andrew
_____________________________
</Chaos, panic, & disorder - my work here is done.>
|
|
|
|
BobbyDouglas
Posts: 5470 Joined: 5/15/2003 From: Arizona Status: offline
|
RE: textarea initial text - 5/19/2004 2:27:57
You can specify the text for a textarea, not sure what you mean by "to the content of an htm file" <textarea rows="5" name="Comments" cols="80">Your Initial Text Here</textarea> If you are wanting to save that information to an htm file, you can use FPextensions, or another script like FormMail. (cgi based scripts)
_____________________________
Arizona Web Design - Mr Bobs Web Design in Arizona The Arizona Web Hosting Challenge
|
|
|
|
SerenityNet
Posts: 1372 Joined: 6/12/2001 From: Allen, TX, USA Status: offline
|
RE: textarea initial text - 5/19/2004 8:30:10
Sorry that I wasn't clear. Here's what I mean... I have an htm file called content.htm (really just an includes file, no head or body tags). Within the textarea tags, where you example showed "Your Initial Text Here", I would want a reference to content.htm. The objective is to have the form opening with the initial text being the actual content of content.htm. Then when I submit the form, I just want the content of content.htm to be replaced with the contents of the textarea. I'm having two problems with this. I can't get the initial text of the textarea to display the contents of content.htm When I do Form Properties / Send To / Filename "_private/content.htm", and unchecking the Options "Include Field Names" and "Latest Results at end", I always get a row of asterisks and a blank row before the content of the textarea. I need to get just exactly the contents of the textarea . Does this make sense?
_____________________________
</Chaos, panic, & disorder - my work here is done.>
|
|
|
|
BobbyDouglas
Posts: 5470 Joined: 5/15/2003 From: Arizona Status: offline
|
RE: textarea initial text - 5/19/2004 11:44:36
Hmmm, you would need a custom form for this I think. If you are trying this in php post some code and I will see if I can work with it to get it working.
_____________________________
Arizona Web Design - Mr Bobs Web Design in Arizona The Arizona Web Hosting Challenge
|
|
|
|
SerenityNet
Posts: 1372 Joined: 6/12/2001 From: Allen, TX, USA Status: offline
|
RE: textarea initial text - 5/19/2004 12:51:34
Too bad. I was hoping FP could be tricked into doing it. I guess it will have to be ASP. I've never even looked at PHP coding. (And it's been almost a year since I've done any ASP.) Andrew
_____________________________
</Chaos, panic, & disorder - my work here is done.>
|
|
|
|
BobbyDouglas
Posts: 5470 Joined: 5/15/2003 From: Arizona Status: offline
|
RE: textarea initial text - 5/19/2004 13:59:28
I don't know any other way to do this. Do you have a point for this? Or are you just experimenting?
_____________________________
Arizona Web Design - Mr Bobs Web Design in Arizona The Arizona Web Hosting Challenge
|
|
|
|
SerenityNet
Posts: 1372 Joined: 6/12/2001 From: Allen, TX, USA Status: offline
|
RE: textarea initial text - 5/19/2004 16:20:40
quote:
Have you tried anything like this?....... bobby I tried exactly that and got a big fat blank textarea. Well, at least I think I tried that. Since you're suggesting it makes me think that it should have worked. When I get home tonight I'll try again. Maybe I just made a typo. Or maybe it is because I used the includes in a FrontPage generated form. Perhaps I need to try a manually created form. Do you think the additional FP form code could have messed it up? quote:
Do you have a point for this? bobby d Amazing as it may seem, this time I actually have a purpose. I'm trying for a very simple implementation of htmlArea. I'll use content.htm as an includes in a regular web page. On another page, in a textarea of a form, I want to pull in the content of content.htm, edit the content with htmlArea, and post the changed content back to content.htm. Voila, a very simple content manager. Later on, I'll probably use the FSO to pull up a list of includes pages that could be edited, but right now I just want one simple page. If you've got better ideas then I'm very open. (By-the-way, I can't use a DB for this project. ASP is as far as I can go.) Thanks, Andrew
_____________________________
</Chaos, panic, & disorder - my work here is done.>
|
|
|
|
SerenityNet
Posts: 1372 Joined: 6/12/2001 From: Allen, TX, USA Status: offline
|
RE: textarea initial text - 5/19/2004 17:01:51
quote:
Unless "htm" is mapped to the asp.dll <edit>or ssinc.dll<edit>, then you wont get an include page from a .htm page. Hmmm, I was thinking that FP only allowed htm documents as includes. But either way, I tried both content.htm and content.txt and neither worked. I also tried the FP web component include without success. quote:
Is your server set to parse for SSI on an HTML page? I don't think so, but when I tried the <!--#include file="content.htm" -->, the form was on an ASP page.
_____________________________
</Chaos, panic, & disorder - my work here is done.>
|
|
|
|
SerenityNet
Posts: 1372 Joined: 6/12/2001 From: Allen, TX, USA Status: offline
|
RE: textarea initial text - 5/19/2004 17:31:51
Spooky, I don't have a clue what you mean. I thought all includes were server side ??? or is that not what you mean by design time? I'm even more lost with the js example. I've used includes lots of times before (both FP Web Component and plain old ASP) without any problems. What is it about putting it within a textarea that's a problem? Or could something else be the problem? htmlArea uses javascript on the page and within the form, but I can't see that would be a problem. I've used javascript on an ASP page before without issues. I admit that I'm totally lost and getting more turned around every minute. Andrew
_____________________________
</Chaos, panic, & disorder - my work here is done.>
|
|
|
|
SerenityNet
Posts: 1372 Joined: 6/12/2001 From: Allen, TX, USA Status: offline
|
RE: textarea initial text - 5/19/2004 18:11:29
I'm trying for a very simple implementation of htmlArea. My thoughts were to... Have a web page called webpage.htm. Have an include (txt or htm, I don't care) on the page for some of the content. The include file will have html code content. Have a second web page, called simpleeditor.asp with a form on it. The textarea of the form will be associated to the htmlArea tool. Open simpleeditor.asp. The textarea should open with the inital value being the content of the include page. Edit the content using htmlArea. Submit the form. This needs to replace the content of the include file with the new content generated within the htmlArea form. The next time someone opens webpage.htm then they will see the new content. This should work as a simple content manager. Andrew
_____________________________
</Chaos, panic, & disorder - my work here is done.>
|
|
|
|
SerenityNet
Posts: 1372 Joined: 6/12/2001 From: Allen, TX, USA Status: offline
|
RE: textarea initial text - 5/19/2004 18:40:47
Agreed. So the next step is try it again tonight. I was probably just making some stupid mistake, because I was tired. I'll take it step-by-step and give a shout if/when I run into problems. Maybe this thread should be moved to the ASP forum (as I'd bet money that I won't get through this without having at least one more question). Thanks again, Andrew
_____________________________
</Chaos, panic, & disorder - my work here is done.>
|
|
|
|
SerenityNet
Posts: 1372 Joined: 6/12/2001 From: Allen, TX, USA Status: offline
|
RE: textarea initial text - 5/19/2004 20:08:31
quote:
Is this what you're trying to do? Yep, that's it. But as you say...quote:
Unfortunately SnippetMaster is PHP.
_____________________________
</Chaos, panic, & disorder - my work here is done.>
|
|
|
|
SerenityNet
Posts: 1372 Joined: 6/12/2001 From: Allen, TX, USA Status: offline
|
RE: textarea initial text - 5/20/2004 1:09:55
Update... Okay the include is working perfect. I can do it with either <!--#include file="../_private/content.txt" --> or <%
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set inFile = FSO.OpenTextFile( Server.MapPath( "../_private/content.txt") )
Response.Write inFile.ReadAll
inFile.Close
Set inFile = nothing
%>I must have just been having a brain cramp last night. I'm still not getting the form to post the updated content back to the content.asp page as I want. I think I'll need to use the FSO Set objTextStream = objFSO.OpenTextFile("content.txt", fsoForWriting, True)to get it the way I want it. Spooky, you wouldn't happen to have a FSO snippet around that can take a form's textarea field and write to a file its contents, would you? Andrew
_____________________________
</Chaos, panic, & disorder - my work here is done.>
|
|
|
|
SerenityNet
Posts: 1372 Joined: 6/12/2001 From: Allen, TX, USA Status: offline
|
RE: textarea initial text - 5/20/2004 9:01:46
This part I've got already (using 4 guys, sloppycode, and the Wrox book you recommended ages ago), but thanks for the additional reference. I really like how the aspfaqs page is organized. It will be helpful. But where I thought I might have a problem is getting the FSO code writing the contents of the textarea on the page to the destination file. Right now I'm writing with...Set objTextStream = objFSO.OpenTextFile("FSO_Write_Result.txt", fsoForWriting, True)
objTextStream.WriteLine "Wow! It works!"but how do I exchange the "Wow! It works!" with the value in the textarea when I press the submit button on the form? Now I must admit that I got the FSO code working, able to write a file and that's where I quit. But just before I turned off the light and went to bed I thought, "Hey, rather than think, let's just ask Spooky, he's still awake and I could have the answer in the morning." What can I say, sometimes I'd just rather be lazy. But I'd still take a hint... Drew PS. quote:
But I'd still take a hint... Hmmm, maybe I shouldn't say it that way.
_____________________________
</Chaos, panic, & disorder - my work here is done.>
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|