How can you put text from a file into a textarea box, when the file is selected from a Select list!

Discussion in 'ASP General' started by Shaiboy_UK, Dec 14, 2004.

  1. Shaiboy_UK

    Shaiboy_UK Guest

    Hi All,

    Hope someone can help here!!

    I'm putting a standard mail page together, that will allow my users to
    sent templete emails out to people. The files are stored in text
    files. I have come up with a script to produce the names into a
    Select list, but know i'm wanting them to be read into a textarea box,
    to allow me to submit them into from the form into the sendmail.asp
    page! but the only way i can pass them out, is into a iframe, which
    doesn't seem to allow me to then pass them into the sendmail.asp page
    for sending.

    Anyone help?

    Cheers
    Shaiboy
     
    Shaiboy_UK, Dec 14, 2004
    #1
    1. Advertising

  2. Are the files on the server?

    Here's a simple method where the page posts back to itself, and there are
    two files in the same directory on the server named file1.txt and file2.txt.

    <%
    Dim sFile
    sFile = Request.Form("cboFile")
    %>

    <body>
    <form method="post" action="self.asp">
    <select name="cboFile" onchange="this.form.submit();">
    <option value="file1.txt"<% If sFile = "file1.txt" Then Response.Write "
    selected=""selected"""%>>File 1</option>
    <option value="file2.txt"<% If sFile = "file2.txt" Then Response.Write "
    selected=""selected"""%>>File 2</option>
    </select>
    <textarea><%If sFile <> "" Then Server.Execute sFile%></textarea>
    <input type="submit" />
    </form>

    Ray at work

    "Shaiboy_UK" <> wrote in message
    news:...
    > Hi All,
    >
    > Hope someone can help here!!
    >
    > I'm putting a standard mail page together, that will allow my users to
    > sent templete emails out to people. The files are stored in text
    > files. I have come up with a script to produce the names into a
    > Select list, but know i'm wanting them to be read into a textarea box,
    > to allow me to submit them into from the form into the sendmail.asp
    > page! but the only way i can pass them out, is into a iframe, which
    > doesn't seem to allow me to then pass them into the sendmail.asp page
    > for sending.
    >
    > Anyone help?
    >
    > Cheers
    > Shaiboy
    >
     
    Ray Costanzo [MVP], Dec 14, 2004
    #2
    1. Advertising

  3. Shaiboy_UK

    Shaiboy_UK Guest

    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:Old%...
    > Are the files on the server?
    >
    > Here's a simple method where the page posts back to itself, and there are
    > two files in the same directory on the server named file1.txt and
    > file2.txt.
    >
    > <%
    > Dim sFile
    > sFile = Request.Form("cboFile")
    > %>
    >
    > <body>
    > <form method="post" action="self.asp">
    > <select name="cboFile" onchange="this.form.submit();">
    > <option value="file1.txt"<% If sFile = "file1.txt" Then Response.Write
    > "
    > selected=""selected"""%>>File 1</option>
    > <option value="file2.txt"<% If sFile = "file2.txt" Then Response.Write
    > "
    > selected=""selected"""%>>File 2</option>
    > </select>
    > <textarea><%If sFile <> "" Then Server.Execute sFile%></textarea>
    > <input type="submit" />
    > </form>
    >
    > Ray at work
    >


    Hi Ray,

    Tried and doesn't work, script at:
    http://www.theukserver.net/testscript/test2.asp
    files all listed at http://www.theukserver.net/testscript/

    Let me know

    Cheers
    Shaiboy
     
    Shaiboy_UK, Dec 14, 2004
    #3
  4. Ray Costanzo [MVP], Dec 14, 2004
    #4
  5. Shaiboy_UK

    Shaiboy_UK Guest

    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:...
    > What "doesn't work" about it? You don't have any file names listed in the
    > dropdown for one thing. Also, the form does not post back to itself.
    >
    > Ray at work
    >


    Hi

    I used the script that you gave!!!

    Cheers
    Shaiboy
     
    Shaiboy_UK, Dec 14, 2004
    #5
  6. No, not quite. View your source and you'll see that you're missing a " and
    a space.

    Ray at home

    "Shaiboy_UK" <> wrote in message
    news:...
    > "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    > message news:...
    >> What "doesn't work" about it? You don't have any file names listed in
    >> the
    >> dropdown for one thing. Also, the form does not post back to itself.
    >>
    >> Ray at work
    >>

    >
    > Hi
    >
    > I used the script that you gave!!!
    >
    > Cheers
    > Shaiboy
    >
    >
     
    Ray Costanzo [MVP], Dec 14, 2004
    #6
  7. Shaiboy_UK

    Shaiboy_UK Guest

    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:e$...
    > No, not quite. View your source and you'll see that you're missing a "
    > and a space.
    >
    > Ray at home
    >


    Missing a " and a space? where? checked the code and was missing a >
    You code wouldn't work with the extra " in it!!!

    Cheers
    Shaiboy
     
    Shaiboy_UK, Dec 15, 2004
    #7
  8. Shaiboy_UK

    Shaiboy_UK Guest

    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:e$...
    > No, not quite. View your source and you'll see that you're missing a "
    > and a space.
    >
    > Ray at home
    >


    Even with this, working, it isn't doing what i want, i want to be able to
    submit this to the sendmail.asp page, but this will just submit it to
    self.asp

    Cheers
    Shaiboy
     
    Shaiboy_UK, Dec 15, 2004
    #8
  9. Shaiboy,

    This is a STARTING point. Yes, this will submit back to itself and load the
    selected file into a textbox. From there, you can write code that handles
    the e-mailing portion if the user submits the form by clicking submit,
    pressing enter, or pressing Ctrl+M.

    Ray at home

    "Shaiboy_UK" <> wrote in message
    news:...
    > "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    > message news:e$...
    >> No, not quite. View your source and you'll see that you're missing a "
    >> and a space.
    >>
    >> Ray at home
    >>

    >
    > Even with this, working, it isn't doing what i want, i want to be able to
    > submit this to the sendmail.asp page, but this will just submit it to
    > self.asp
    >
    > Cheers
    > Shaiboy
    >
    >
     
    Ray Costanzo [MVP], Dec 15, 2004
    #9
  10. Shaiboy_UK

    Shaiboy_UK Guest

    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:...
    > Shaiboy,
    >
    > This is a STARTING point. Yes, this will submit back to itself and load
    > the selected file into a textbox. From there, you can write code that
    > handles the e-mailing portion if the user submits the form by clicking
    > submit, pressing enter, or pressing Ctrl+M.
    >
    > Ray at home
    >


    Ray,

    Can you email me directly?

    Cheers
    Shaiboy
     
    Shaiboy_UK, Dec 17, 2004
    #10
  11. "Shaiboy_UK" <> wrote in message
    news:...

    > Ray,
    >
    > Can you email me directly?


    Like, if you want to go hang out and drink beers or something, then sure,
    let's go! But as far as this topic, usenetiquette mandates the conversation
    remains here. Regardless, my e-mail address is discernable from my bogus
    address when I post.

    Ray at work
     
    Ray Costanzo [MVP], Dec 17, 2004
    #11
  12. Shaiboy_UK

    Shaiboy_UK Guest

    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:%...
    >
    >
    > Like, if you want to go hang out and drink beers or something, then sure,
    > let's go! But as far as this topic, usenetiquette mandates the
    > conversation
    > remains here. Regardless, my e-mail address is discernable from my bogus
    > address when I post.
    >
    > Ray at work
    >
    >


    Don't matter, all sorted now, just iframe, textarea and read commands.

    Cheers anyway.
    Shaiboy
     
    Shaiboy_UK, Dec 22, 2004
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gnarlodious
    Replies:
    4
    Views:
    17,644
    elizas
    May 5, 2010
  2. Replies:
    63
    Views:
    14,789
    christhevet
    Mar 20, 2011
  3. palmiere
    Replies:
    1
    Views:
    434
    Erwin Moller
    Feb 9, 2004
  4. STB
    Replies:
    4
    Views:
    154
    Thomas 'PointedEars' Lahn
    Oct 16, 2004
  5. mariomueller
    Replies:
    2
    Views:
    566
    mariomueller
    Aug 24, 2006
Loading...

Share This Page