navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

textarea initial text

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> textarea initial text
Page: [1]
 
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

(in reply to SerenityNet)
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.>

    (in reply to BobbyDouglas)
  • 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

    (in reply to SerenityNet)
    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.>

    (in reply to BobbyDouglas)
    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

    (in reply to SerenityNet)
    bobby

     

    Posts: 11394
    Joined: 8/15/1969
    From: Seattle WA USA
    Status: offline

     
    RE: textarea initial text - 5/19/2004 14:26:25   
    Have you tried anything like this?

    <textarea rows="5" name="Comments" cols="80"><!--#include file="content.htm" --></textarea>


    _____________________________

    If con is the opposite of pro, is Congress the opposite of progress?


    :)

    (in reply to BobbyDouglas)
    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.>

    (in reply to bobby)
    Spooky

     

    Posts: 26606
    Joined: 11/11/1998
    From: Middle Earth
    Status: offline

     
    RE: textarea initial text - 5/19/2004 16:33:18   
    Unless "htm" is mapped to the asp.dll <edit>or ssinc.dll<edit>, then you wont get an include page from a .htm page.
    The parent would need to be asp (or some other script) so that the file could be included.

    Another method may be to use javascript document.write and an included .js file

    < Message edited by Spooky -- 5/19/2004 16:42:23 >


    _____________________________

    If you arent part of the solution, then there is good money to be made prolonging the problem

    §þ:)


    (in reply to SerenityNet)
    bobby

     

    Posts: 11394
    Joined: 8/15/1969
    From: Seattle WA USA
    Status: offline

     
    RE: textarea initial text - 5/19/2004 16:34:50   
    quote:

    I tried exactly that and got a big fat blank textarea.

    Is your server set to parse for SSI on an HTML page?

    It may not even recognize the code for an include it it isn't... and would return a blank (comment). You could always try an FP component include instead..?

    Otherwise it should copy exactly whats on content.htm and paste it right into the page code before it gets sent to the browser...

    _____________________________

    If con is the opposite of pro, is Congress the opposite of progress?


    :)

    (in reply to SerenityNet)
    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.>

    (in reply to bobby)
    Spooky

     

    Posts: 26606
    Joined: 11/11/1998
    From: Middle Earth
    Status: offline

     
    RE: textarea initial text - 5/19/2004 17:12:14   
    quote:

    I was thinking that FP only allowed htm documents as includes

    They are design time includes, not run time.
    A design time include already exists in the page before the page is served up by the server

    _____________________________

    If you arent part of the solution, then there is good money to be made prolonging the problem

    §þ:)


    (in reply to SerenityNet)
    Spooky

     

    Posts: 26606
    Joined: 11/11/1998
    From: Middle Earth
    Status: offline

     
    RE: textarea initial text - 5/19/2004 17:20:25   
    A basic JS example :

    <script language="JavaScript">
    document.write('<textarea>Testing</textarea>');
    </script>


    That could be an included js file or any type of client side scripting. Depends what you are doing :)

    _____________________________

    If you arent part of the solution, then there is good money to be made prolonging the problem

    §þ:)


    (in reply to Spooky)
    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.>

    (in reply to Spooky)
    Spooky

     

    Posts: 26606
    Joined: 11/11/1998
    From: Middle Earth
    Status: offline

     
    RE: textarea initial text - 5/19/2004 17:49:40   
    Perhaps explain a little more what you want to do :)

    Includes can be done (as above) like some of these examples

    1) FP design time (not 'real' includes as the code is actually inserted as a 'bot')
    The file is just sent to the user
    2) Runtime (The server includes the requested file when served to the user)
    The file must be parsed by the server to insert scripted content
    3) Client side (a js file is passed to the client and then displayed

    _____________________________

    If you arent part of the solution, then there is good money to be made prolonging the problem

    §þ:)


    (in reply to SerenityNet)
    bobby

     

    Posts: 11394
    Joined: 8/15/1969
    From: Seattle WA USA
    Status: offline

     
    RE: textarea initial text - 5/19/2004 18:06:07   
    Try an FP include... You can add it anywhere on the page in design view, then find the 'bot code and move it into the textarea tags in HTML view.

    <edit>
    Insert > Component > Web Component > Include Page

    then point the wizard at content.htm

    (or something along those lines...)

    < Message edited by bobby -- 5/19/2004 15:06:53 >


    _____________________________

    If con is the opposite of pro, is Congress the opposite of progress?


    :)

    (in reply to Spooky)
    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.>

    (in reply to Spooky)
  • SerenityNet

     

    Posts: 1372
    Joined: 6/12/2001
    From: Allen, TX, USA
    Status: offline

     
    RE: textarea initial text - 5/19/2004 18:16:54   
    Sorry, Bobby, I responded to Spooky while you were responing to me.

    quote:

    Try an FP include... You can add it anywhere on the page in design view, then find the 'bot code and move it into the textarea tags in HTML view.


    Yep. Did that too. That's why I'm really getting stumped. I've done all these individual tasks many times before. I don't know why they are not working now. All I know is to try again tonight, when I get home. Maybe because it was late and I was tired, I was just making some stupid mistake.   :)


    < Message edited by SerenityNet -- 5/20/2004 17:17:43 >


    _____________________________

    </Chaos, panic, & disorder - my work here is done.>

    (in reply to SerenityNet)
    Spooky

     

    Posts: 26606
    Joined: 11/11/1998
    From: Middle Earth
    Status: offline

     
    RE: textarea initial text - 5/19/2004 18:25:24   
    Ahh - ok.
    I really think youll need to look at asp (or similar) for that task.
    The 'state' of the include would need to be maintained by a file or database.

    Using the FP include, as its design time, wont do it.

    As you are working with asp, I would simply start with webpage.htm becoming webpage.asp and using SSI

    <!--#include file="content.asp" -->

    _____________________________

    If you arent part of the solution, then there is good money to be made prolonging the problem

    §þ:)


    (in reply to SerenityNet)
    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.>

    (in reply to Spooky)
    jaybee

     

    Posts: 14191
    Joined: 10/7/2003
    From: Berkshire, UK
    Status: offline

     
    RE: textarea initial text - 5/19/2004 19:38:06   
    It's very late here and the old brain is getting a bit fuggy so I'm not sure that I'm 100% clear on this but here goes......

    Take a look at this web page.

    http://thrust.mysuperhost.co.uk/normanking.co.uk/events.html

    Is this what you're trying to do? Everything in the box is controlled by SnippetMaster and can be updated by the site owner. If you click on the events logo (bottom left) it'll bring up a log in page.

    I've given you that link rather than the masked page so you can see the source code. Everything between the <snippet> tags is included automatically, it effectively rewrites the page.

    Unfortunately SnippetMaster is PHP.

    _____________________________

    If it ain't broke..... fix it until it is.
    :)

    :)
    GAWDS
    Now where did I put that Doctype?

    (in reply to SerenityNet)
    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.>

    (in reply to jaybee)
    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.>

    (in reply to SerenityNet)
    Spooky

     

    Posts: 26606
    Joined: 11/11/1998
    From: Middle Earth
    Status: offline

     
    RE: textarea initial text - 5/20/2004 1:50:53   
    Check out something like :

    http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=148

    Or :

    http://www.aspfaq.com/show.asp?id=2039#append

    _____________________________

    If you arent part of the solution, then there is good money to be made prolonging the problem

    §þ:)


    (in reply to SerenityNet)
    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.>

    (in reply to Spooky)
    Page:   [1]

    All Forums >> Web Development >> General Web Development >> textarea initial text
    Page: [1]
    Jump to: 1





    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