473,714 Members | 2,500 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.c o.uk
Jul 22 '05 #1
11 5647
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("c boFile")
%>

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

Ray at work

"Shaiboy_UK " <sh********@yah oo.co.uk> wrote in message
news:2d******** *************** ***@posting.goo gle.com...
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.c o.uk

Jul 22 '05 #2
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:Ol******** ********@TK2MSF TNGP09.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("c boFile")
%>

<body>
<form method="post" action="self.as p">
<select name="cboFile" onchange="this. form.submit();" >
<option value="file1.tx t"<% If sFile = "file1.txt" Then Response.Write
"
selected=""sele cted"""%>>File 1</option>
<option value="file2.tx t"<% If sFile = "file2.txt" Then Response.Write
"
selected=""sele cted"""%>>File 2</option>
</select>
<textarea><%I f 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.c o.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.uk...


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.c o.uk

Jul 22 '05 #4
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:uf******** ******@TK2MSFTN GP14.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.c o.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******** *****@individua l.net...
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:uf******** ******@TK2MSFTN GP14.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.c o.uk

Jul 22 '05 #6
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:e$******** ******@TK2MSFTN GP14.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.c o.uk
Jul 22 '05 #7
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:e$******** ******@TK2MSFTN GP14.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.c o.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******** *****@individua l.net...
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:e$******** ******@TK2MSFTN GP14.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.c o.uk

Jul 22 '05 #9
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:Ov******** ******@TK2MSFTN GP10.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.c o.uk
Jul 22 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
9325
by: Doug van Vianen | last post by:
Hi, I am working on an Applet which provides some mouse practice for new computer users in our local seniors' computer club. The applet contains several cards, in a card layout, which are displayed to the user one after the other as needed to present some particular mouse operation. This all works fine. One card (card 4 below) includes a textarea and a button. What I wish to do is have the user use the mouse to select some text from the...
5
18024
by: Andrew V. Romero | last post by:
At work we have an excel file that contains the list of medications and their corresponding strengths. I would like to save the excel file as a text list and paste this list into a javascript function and have JS put this into an array. Then JS would use this array to create a selection list which displays only the names of the drugs. When the user selections one of the drugs, another selection list will be loaded with the avaiable...
20
12423
by: Dannyboyo | last post by:
I have what I hope is a simple request. I can't really code in javascript, but I am pretty good at cusomizing it with slight modifications. I code in ASP and HTML. I am trying to capture customer input of product names to put on custom labels we make. Some of the labels will have our product names on them, but the customer can add other products that we do not sell. So, on my product detail page I want a textbox that can have rows copied...
7
1988
by: Razzbar | last post by:
I have a textarea and some buttons. The buttons apply functions to the text the user selects, i.e. the good old "wrap with a tag" thing we all have seen in 100 different editors. Trouble is, when I click the button, the selected text gets unselected. Select some text in the textbox and click -anywhere- and the text unselects. I want that text to stay selected!
19
6925
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the JavaScript in this code from a couple different sites but I'm not 100% sure what each line is doing...This is the ASP code that I'm using for the page....Take a look at the JavaScript code and please let me know what each line is doing....I have been...
3
4901
by: Junoon | last post by:
hi all, I am trying to get the values of the item selected in a select list box into a textarea, but the code is not working....Where am i going wrong???? whenever i click on any item in the list, the corresponding value for it will get displayed in the text area..... Also, is there a way to get data from a text file into the textarea,
4
21013
by: devine | last post by:
Hi All, I am VERY new to Javascript. I have been provided with some code, which will enable me to hide/show a text area and change a submit button dependant on a check box. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
1
1720
by: jschlosser | last post by:
I can enable a text box with an onChange if ANY option is selected from a select list, but how do I do this for a specific selection? Even better would be if the field didn't appear until after the event. This is for those selecting "other" to tell us what "other" is. Thanks. J Schlosser
0
8801
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
8707
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9314
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9015
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5947
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4464
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4725
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2110
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.