Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > How can you put text from a file into a textarea box, when the file is selected from a Select list!

Reply
Thread Tools

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

 
 
Shaiboy_UK
Guest
Posts: n/a
 
      12-14-2004
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
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      12-14-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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
> (E-Mail Removed)



 
Reply With Quote
 
 
 
 
Shaiboy_UK
Guest
Posts: n/a
 
      12-14-2004
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:Old%(E-Mail Removed)...
> 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
(E-Mail Removed)


 
Reply With Quote
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      12-14-2004
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

"Shaiboy_UK" <(E-Mail Removed)> wrote in message
news:QZGvd.13186$(E-Mail Removed) k...
>
>
> 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
> (E-Mail Removed)
>
>



 
Reply With Quote
 
Shaiboy_UK
Guest
Posts: n/a
 
      12-14-2004
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:(E-Mail Removed)...
> 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
(E-Mail Removed)


 
Reply With Quote
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      12-14-2004
No, not quite. View your source and you'll see that you're missing a " and
a space.

Ray at home

"Shaiboy_UK" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
> message news:(E-Mail Removed)...
>> 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
> (E-Mail Removed)
>



 
Reply With Quote
 
Shaiboy_UK
Guest
Posts: n/a
 
      12-15-2004
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:e$(E-Mail Removed)...
> 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
(E-Mail Removed)


 
Reply With Quote
 
Shaiboy_UK
Guest
Posts: n/a
 
      12-15-2004
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:e$(E-Mail Removed)...
> 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
(E-Mail Removed)


 
Reply With Quote
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      12-15-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
> message news:e$(E-Mail Removed)...
>> 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
> (E-Mail Removed)
>



 
Reply With Quote
 
Shaiboy_UK
Guest
Posts: n/a
 
      12-17-2004
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:(E-Mail Removed)...
> 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
(E-Mail Removed)


 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
textarea: get text left and right from selected text mariomueller Javascript 2 08-24-2006 04:49 AM
Changing selected text in textarea aqualizard@gmail.com Javascript 5 04-02-2005 07:53 PM
Can JS detect SELECTED text in a textArea STB Javascript 4 10-16-2004 10:37 PM
Replacing selected text in textarea Rob Javascript 0 01-30-2004 09:11 AM



Advertisments