469,271 Members | 1,161 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

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

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
sh**************@NOSPAMyahoo.co.uk
Jul 22 '05 #1
11 5336
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" <sh********@yahoo.co.uk> wrote in message
news:2d**************************@posting.google.c 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
sh**************@NOSPAMyahoo.co.uk

Jul 22 '05 #2
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:Ol****************@TK2MSFTNGP09.phx.gbl...
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
sh**************@NOSPAMyahoo.co.uk
Jul 22 '05 #3
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" <sh**************@NOSPAMyahoo.co.uk> wrote in message
news:QZ******************@fe1.news.blueyonder.co.u 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
sh**************@NOSPAMyahoo.co.uk

Jul 22 '05 #4
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:uf**************@TK2MSFTNGP14.phx.gbl...
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
sh**************@NOSPAMyahoo.co.uk
Jul 22 '05 #5
No, not quite. View your source and you'll see that you're missing a " and
a space.

Ray at home

"Shaiboy_UK" <sh**************@yahoo.co.uk> wrote in message
news:32*************@individual.net...
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:uf**************@TK2MSFTNGP14.phx.gbl...
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
sh**************@NOSPAMyahoo.co.uk

Jul 22 '05 #6
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:e$**************@TK2MSFTNGP14.phx.gbl...
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
sh**************@NOSPAMyahoo.co.uk
Jul 22 '05 #7
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:e$**************@TK2MSFTNGP14.phx.gbl...
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
sh**************@NOSPAMyahoo.co.uk
Jul 22 '05 #8
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" <sh**************@NOSPAMyahoo.co.uk> wrote in message
news:32*************@individual.net...
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:e$**************@TK2MSFTNGP14.phx.gbl...
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
sh**************@NOSPAMyahoo.co.uk

Jul 22 '05 #9
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:Ov**************@TK2MSFTNGP10.phx.gbl...
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
sh**************@NOSPAMyahoo.co.uk
Jul 22 '05 #10

"Shaiboy_UK" <sh**************@NOSPAMyahoo.co.uk> wrote in message
news:32*************@individual.net...
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
Jul 22 '05 #11
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:%2****************@TK2MSFTNGP11.phx.gbl...


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
sh**************@NOSPAMyahoo.co.uk
Jul 22 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Doug van Vianen | last post: by
5 posts views Thread by Andrew V. Romero | last post: by
20 posts views Thread by Dannyboyo | last post: by
7 posts views Thread by Razzbar | last post: by
19 posts views Thread by dmiller23462 | last post: by
3 posts views Thread by Junoon | last post: by
1 post views Thread by jschlosser | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.