473,729 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List <a> tags in a textarea

Is it possible to create a dropdown list populated by the contents of a textarea?

<textarea>
<a name="this">thi s</a>
<a name="that">tha t</a>
</textarea>

Then, the dropdown would have the <a> values as options...

Please reply to

just1coder -at- yahoo -dot- ca
Jul 23 '05 #1
4 1279
just1coder wrote:
Is it possible to create a dropdown list populated by the contents of a textarea?

<textarea>
<a name="this">thi s</a>
<a name="that">tha t</a>
</textarea>

Then, the dropdown would have the <a> values as options...
Sure.
Please reply to

just1coder -at- yahoo -dot- ca


No thanks. Ask in News, get answered in News.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jul 23 '05 #2
Randy Webb <hi************ @aol.com> wrote in message news:<-b************** ******@comcast. com>...
just1coder wrote:
Is it possible to create a dropdown list populated by the contents of a textarea?

<textarea>
<a name="this">thi s</a>
<a name="that">tha t</a>
</textarea>

Then, the dropdown would have the <a> values as options...


Sure.
Please reply to

just1coder -at- yahoo -dot- ca


No thanks. Ask in News, get answered in News.


I was looking for an example.
Jul 23 '05 #3
ju********@yaho o.ca (just1coder) writes:
> Is it possible to create a dropdown list populated by the
> contents of a textarea?
>
> <textarea>
> <a name="this">thi s</a>
> <a name="that">tha t</a>
> </textarea>
>
> Then, the dropdown would have the <a> values as options...

How? Should the option's value/text be '<a name="this">thi s</a>' or
should it be 'this'?

.... I was looking for an example.

---
var text = document.getEle mentById("textA reaId").value;
var select = document.getEle mentById("selec tId");
var lines = text.split("\n" );
for (var i in lines) {
if (lines[i]!="") {
select.options[select.options. length]=new Option(lines[i]);
}
}
---
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #4
just1coder wrote:
Randy Webb <hi************ @aol.com> wrote in message news:<-b************** ******@comcast. com>...
just1coder wrote:
Is it possible to create a dropdown list populated by the contents of a textarea?

<textarea>
<a name="this">thi s</a>
<a name="that">tha t</a>
</textarea>

Then, the dropdown would have the <a> values as options...


Sure.

I was looking for an example.


Not what you asked, but ok.

Assuming that your textarea will *Always* be formatted in that format,
its simply a matter of getting the name and the text. I think you wanted
href= instead of name= though.

Some hints:

get the .value of the textarea, and then parse it for the name(href) and
the text.
http://msdn.microsoft.com/library/de...jsmthsplit.asp
http://msdn.microsoft.com/library/de...astindexof.asp
http://msdn.microsoft.com/library/de...mthindexof.asp
http://msdn.microsoft.com/library/de...hsubstring.asp

Split the .value of the textarea.
Now, you get the indexOf the ", the last indexOf the ", and the
substring, that will give you the href/name.
Then, you repeat for indexOf >, then the lastIndexOf <, then the
substring will give you the text.

That will give you a pretty good start, some good reading, and some
practice. Post back with your best effort........
--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jul 23 '05 #5

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

Similar topics

1
4725
by: Augustus | last post by:
Hiya, I have a form with a <textarea></textarea> to receive user input. This input is then stored in a database and sent by fax... I need to be able to remove the carriage returns (enter key... vbcrlf...) from the input so that somebody doesn't do something like fill the textarea with 100s of keypresses of the enter key and end up spitting out tonnes of blank pages on the fax machine
2
3224
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are writing one object in C# which will take the entire table tag contents and renders. Ie., we need to pass "<table>………… <thead>……</thead>. <tr>.<td> <td>..<tr>.<td> <td> </table>" content to
2
10562
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script type="text/javascript"> <!]> </script> <script type="text/javascript"
17
2270
by: Albert Wagner | last post by:
I have a page with two frames. Frame1 contains an inline script. Frame2 contains inline and 2 loaded scripts. How may I call a function in frame1(inline) from frame2(inline or loaded)? Albert
2
2068
by: Tom Vogel | last post by:
I'd like to use the XML Documentation Tags to comment my C# code. But many of the tags do not have any effect when I execute the "Build Comment Web Pages" menu. For example, the <list> tag gets reendered as is. The resulting HTML page contains the exact same tags, which are not valid HTML. The same with <see> or <see also>. Isn't this function supposed to transform these tags into valid HTML? Did anybody see this work properly?
4
52988
by: matty.hall | last post by:
I have two classes: a base class (BaseClass) and a class deriving from it (DerivedClass). I have a List<DerivedClass> that for various reasons needs to be of that type, and not a List<BaseClass>. However, I need to cast that list to a List<BaseClass> and it is not working. The code is below. I get the following exception: "Unable to cast object of type 'System.Collections.Generic.List`1' to type 'System.Collections.Generic.List`1'." ...
8
2274
by: ASP Yaboh | last post by:
I have an ArrayList of data gathered from a database. I want to create a web page from this data by creating a <table>, each cell in each row displays the appropriate data. One of those cells in each row needs a <textarea> control. The background supporting classes are completed, the only task left now is to create the web page. I am at a loss on how to create the table in the page populated by the data. Previously, I would have just...
7
57554
by: Andrew Robinson | last post by:
I have a method that needs to return either a Dictionary<k,vor a List<v> depending on input parameters and options to the method. 1. Is there any way to convert from a dictionary to a list without itterating through the entire collection and building up a list? 2. is there a common base class, collection or interface that can contain either/both of these collection types and then how do you convert or cast from the base to either a...
3
3377
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt, &gt ,&ltCompany&gt to display '<', '>' and '<Company>' respectively. But is there any freeware code available which could implement the above functionality without having to use &gt,&lt and such stuff???
14
3157
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the PHP interpreter works like any other, that is, it first expands all the include files, and then parses the resulting text. Can anyone help with an explanation? Thanks, M. McDonnell
0
8925
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
9154
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
8156
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6026
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
4531
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...
1
3240
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2692
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2166
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.