JavaScript - Using Javascript To Generate Html Code Into Textarea
I've done a bit of searching and I can't find the answer to my question. I'm working on a website for my business. I have some basic knowledge of coding but I'm mostly a code cobbler. I find various pieces and put it together and hope it works so take it easy on me.
I have some code to display products on my site. It works fine. We just have a lot of products and for me to add each one by hand was getting ridiculous. I finally had the bright idea to use Javascript to generate the code for me and then copy it back into my actual HTML page. Last night I wrote the code below. It works perfectly except I have to constantly "View Source" in order to get the code. I was hoping to cut down on a step or two and have the code go into a TextArea. From there I can just select it and copy it into the HTML file. It should make things a little quicker and most importantly easier. Maybe after that I'll try to figure out how to write function to select everything in the TextArea and copy it to my clipboard. That would make things even faster. Any help? Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <SCRIPT LANGUAGE="JavaScript"> function calc (form) { var images = form.images.value; var imagesArray = images.split("\n"); var linebreak = "<br />"; var i=0; var j=0; var a=0; while(i < imagesArray.length) { if(j==0) { document.write (" <!-- -------------------------------------------- -->\n"); document.write (" <div id=\"cols3-top\"></div>\n"); document.write (" <div id=\"cols3\" class=\"box\">\n"); } a++; if(j/2!=1) { if(a==imagesArray.length) { document.write ("\n <!-- ---------------- -->\n\n"); document.write (" <div class=\"col last\">\n"); document.write (" <h3>Header</h3>\n"); document.write (" <p class=\"nom t-center\">\n"); document.write (" <a href=\"../../product_imgs/resins/pdu/54xxxgs/" + imagesArray[i] + ".jpg\" class=\"nivoZoom center\"><img src=\"../../product_imgs/resins/pdu/54xxxgs/" + imagesArray[i] + ".jpg\" alt=\"" + imagesArray[i] +"\" height=\"200px\" /></a></p>"); document.write (" <!-- /col-text -->\n"); document.write (" <div class=\"col-itemnum\">PDU: " + imagesArray[i] + "</div>\n"); document.write (" </div>\n"); document.write (" <!-- /col -->\n"); document.write (" <hr class=\"noscreen\" />\n"); document.write (" </div>\n"); document.write (" <div id=\"cols3-bottom\"></div>\n"); document.write (" <!-- /Columns End Here -->\n\n\n"); break; } else { document.write ("\n <!-- ---------------- -->\n"); document.write (" <div class=\"col\">\n"); document.write (" <h3>Header</h3>\n"); document.write (" <p class=\"nom t-center\">\n"); document.write (" <a href=\"../../product_imgs/resins/pdu/54xxxgs/" + imagesArray[i] + ".jpg\" class=\"nivoZoom center\"><img src=\"../../product_imgs/resins/pdu/54xxxgs/" + imagesArray[i] + ".jpg\" alt=\"" + imagesArray[i] +"\" height=\"200px\" /></a></p>"); document.write (" <!-- /col-text -->\n"); document.write (" <div class=\"col-itemnum\">PDU: " + imagesArray[i] + "</div>\n"); document.write (" </div>\n"); document.write (" <!-- /col -->\n"); document.write (" <hr class=\"noscreen\" />\n"); i++; j++; } } else { document.write ("\n <!-- ---------------- -->\n\n"); document.write (" <div class=\"col last\">\n"); document.write (" <h3>Header</h3>\n"); document.write (" <p class=\"nom t-center\">\n"); document.write (" <a href=\"../../product_imgs/resins/pdu/54xxxgs/" + imagesArray[i] + ".jpg\" class=\"nivoZoom center\"><img src=\"../../product_imgs/resins/pdu/54xxxgs/" + imagesArray[i] + ".jpg\" alt=\"" + imagesArray[i] +"\" height=\"200px\" /></a></p>"); document.write (" <!-- /col-text -->\n"); document.write (" <div class=\"col-itemnum\">PDU: " + imagesArray[i] + "</div>\n"); document.write (" </div>\n"); document.write (" <!-- /col -->\n"); document.write (" <hr class=\"noscreen\" />\n"); document.write (" </div>\n"); document.write (" <div id=\"cols3-bottom\"></div>\n"); document.write (" <!-- /Columns End Here -->\n\n\n"); i++; j=0; } } document.close(); } </script> </head> <body> <div style="width:960px; margin:0 auto;"> <form name="myform" method="get" action=""> <textarea label="Image Names:"name="images" cols="30" rows="15" onclick="this.value=''" ></textarea> <p> <label> <input type="button" name="calculate" value="Calculate" onClick="calc(this.form)"/> </label> </p> </form> </div> </body> </html> Similar TutorialsHi, I have a problem. please help me in this regard. I have a combobox which contain numeric values from 1-7. i want to generate a table with 2 rows and 4 columns through javascript. Means when a user select numeric value like '3' from a combo box then a page generates '3' tables without refreshing a page. And if a user selects '4' from a combobox then a script generates 4 tables with 2 rows and 4 columns and so on. kindly guide me that how can i mkae this javascript. plz help If I have a javascript var in a webpage(html form textarea VALUE - yui) that contains html code, and want to appear it, in confirmformpage.php, then how to transfer it...? is it really needed go via PHP ...? and ofcourse use innerHTML to write it....yes I usually use an intermitened processform.php script. http://developer.yahoo.com/yui/editor hi, I have some HTML to edit in my database, in my back end administration I have it in a textarea but when I go to edit it, it all messes up and lots of '/' area added, see below: Code: Site Design by: <a href=\\\\\\\"http://www.jbiddulph.com\\\\\\\" target=\\\\\\\"_blank\\\\\\\" title=\\\\\\\"John Biddulph - Web Development\\\\\\\">jbiddulph.com</a> php code Code: <p> <label>Site Design by</label> <textarea class="text-input small-input" name="SiteDesignby"><?php echo $row1['SiteDesignby'] ?></textarea> </p> Can anyone help please? I am looking for a javascript code for this idea under this message ---------------------------------------------------------------------------------------------------------------------------------------------------- I want to create a kind of shopping website so when you click on a image or text it will add some text to a textarea,, it will include the name of item and price of an item favorite I'd like to modify a form on www.formsite.com (form builder app): username: testuser password: password I would like to use the nicedit.com's inline content editor's js to transform my textarea's into a richtext area. At present the nicedit editor works well in creating the richtextarea. However, the KEY point is that I would like formsite's form to pipe in the the created html and render it with the html component of formsite. Currently, the pipe function in formsite will only put out the html syntax in it's html module. action seen he http://fs8.formsite.com/testform/form1/index.html So this would be: 1. checking out my form on formsite.com 2. the script from nicedit.com is already installed in an html component. 3. changing or telling me the scripts/tags/or whatever for formsite form using formsites form builder (which allows some html/script editing). 4. changed so as to render the rich text entered on page 1 in page 2 instead of the html syntax. Any other solutions using formsite and any other richtextarea solutions would be great too! ok so heres where I stand, I don't know too much about javascript. Just enough to get me by. I am a PHP developer, I know how to do this in PHP but the client insists on doing it through javascript. Basically there are 3 different form values that determine the Premium Death Benefit Ratio. This is the formula the client wants: Premium to Death Benefit Ratio % (Created by formula = Annual (Level) Premium Amount (Divided by) Death Benefit Amount (equals a percentage) That percentage multiplied by Life Expectancy The 3 form values in the formula would be Annual Premium Amount (fypremium), Death Benefit Amount (dbp), Life Expectancy (average_le) I was messing around with javascript trying to figure it out and I have gotten no where since I am not used to writing formulas in JS. Anyways here is what I have so far: Code: function calculateLE(inputFieldId1, inputFieldId2, inputFieldId3, outputFieldId){ var DBR; var input = document.getElementById(inputFieldId).value; APA = document.getElementById(fypremium).value; DBA = document.getElementById(dbp).value; LE = document.getElementById(average_le).value; formula = document.getElementById(fypremium).value / document.getElementById(dbp).value = formula3; formula2 = document.getElementById(average_le).value * formula3; if { APA = "" } { document.getElementById(outputFieldId).value = "Error getting Annual Premium Amount"; } else if { DBA = "" } { document.getElementById(outputFieldId).value = "Error getting Death Benefit Amount"; } else if { LE = "" } { document.getElementById(outputFieldId).value = "Error getting Life Expectancy"; } else { document.getElementById(outputFieldId).value = formula3; } } Now I honestly have no clue if I am on the right track but what i've found on the net hasnt really pointed me in the right direction Here is the form values. Code: <input type="text" name="fypremium" id="fypremium" onblur="calculateLE('fypremium', 'dbp', 'average_le', 'premium_dbr')"> <input type="text" name="dbp" id="dbp" onblur="calculateLE('fypremium', 'dbp', 'average_le', 'premium_dbr')"> <input type="text" name="average_le" id="average_le" onblur="calculateLE('fypremium', 'dbp', 'average_le', 'premium_dbr')"> In a nut shell the values for the 3 inputs stated above will determine premium_dbr's value. fypremium / dbp = percentage; average_le * percentage = DBR (death benefit ratio); If someone could point me in the right direction to finishing this id be very greatful. Hi All, i want to achieve an effect like the following, please help 1. i want to get the current time, possibility no from client computer ( sometimes their time is wrong)? i dont know whether can achieve but if cannot, then never mind, just get from client computer. 2. for example now is 1:25 am, i want to generate dynamically every half an hour timing from 2 am(round up) till for example 11 am something like <select> <option>2:00</option> <option>2:30</option> ................ <option>11:00</option> </select> for me this is a bit complicated, anybody can help me? <option>3:00</option> Hello, I'm a complete javascript beginner so sorry if I'm just being stupid I wanted to know if it's possible for me to add a picture (as in a .png file) to a page by clicking on something which would then make an image appear on the screen (which I would then want to be able to drag and move but I made a different thread for that question) I hope this explanation made sense Thank you for your time Hello HTML CODE TUTORIAL support, I am aryan. A student of engg. I want simple help in following code : It is simple 4 You and difficult 4 Me :unsu ================================================ <html> <head></head> <title>Mad </title> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>MAD</title> <script language="javascript" type="text/javascript"> function session() { var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"; var str = ''; for (var i=0; i<10; i++) { var b = Math.floor(Math.random() * chars.length); str += chars.substring(b,b+1); } document.frm.un.value = str; document.frm.s.value = str; document.frm.capt.src =" Free games - MAD.com init?w=120&h=40&f=png&s="+ str; document.getElementById("c").focus(); } </script> </head> <body> <form action='http://mad.com/ register' method='post' id='cI' enctype='text/plain'><p><input name='s' id='s' value='GENERATED 10 CHARACTERS HERE'' type='hidden'><p><input name='did' id='did' value='NEHA' type='hidden'><p><input name='pid' id='pid' value='twinkle' type='hidden'><p><input name='cid' id='cid' value='twinkle' type='hidden'><p><input name='l' id='l' value='en' type='hidden'> <p> <b>USERNAME</b><br> <input name='un' id='un' value='aliya_loves7' ><p><b>PASSWORD</b><br> <input name='pw' id='pw' value='Iaminhell8*'></p><p> <img src='http://mad.com/init? w=120&h=40&f=png&s=GENERATED 10 CHARACTERS HERE'></p><p> captcha <br><input name='c' id='c'><br><br><input name='send' value=' CREATE ' type='submit'></ form></font> </head> ================================================== In this code i wrote code in italic font. Which is modified by me And i want to know it is wrong or right ? I want to know exact what is wrong here. I tried many times but getting error. And i also want to know When i click on CREATE button, <img src='http://mad.com/init? w=120&h=40&f=png&s="GENERATED 10 CHARACTERS HERE> This value want to change automatically for next session But dont open next page i want to change this in that page likes Refresh Captcha when i press CREATE button One more thing I Have Four input Value ABHI,AKKI,SIMRAN,PRINCE I want to replace this value into NEHA input value. [You can see in code] I also want to change this value when Img src refreshed Please Help me I would like to remove some hosting imposed google ads on my phpbb board. Currently I accomplish this by deleting via javascript all the banners divs when the page is loaded. But unfortunately in that way advertisements are quickly displayed before disappearing. Now I am thinking about a different (neater) approach to my problem: maybe I might write some javascript code which interferes with the one injected by google thus generating the inability to show those annoying divs... Any idea? Hey guys I'm trying to figure out the best/easiest/fastest way to accomplish this task: I have a csv file I need to generate an HTML item description based on the infomation in this csv Here is an example: ITEM NAME, ITEM TITLE, MANUFACTURE, CONDITION, LAST PHOTO LINK, I would then need the script to generate the HTML markup AND I will also need the script to determine if the last photo in the list is photo "c" and then create the links for photos a-c ie: <b>ITEM NAME<b><br> <i>ITEM TITLE</i><br> <img src="photoa.jpg"><img src="photob.jpg"><img src="photoc"><br><br> ect.... I'm sure there is a good way to do this I'm just not sure which language will be the easiest to do it in. If there is a way to use java I am most familiar with java. I would also like the script to export the data in a csv file as well if possible. Thanks for any advice guys! Please if you have any reference links post them! Hi! I'm start learning javascript and can't solve one problem. I need to case user click first radiobutton browser show him first form ($mat1), else second. For example, I have this php code: PHP Code: $mat1="<span id="form_notes_text">".$saved_info."</span><br>\ <input class=\"form_notes_element\" value="0" type="text" name="name" maxlength="9"><br><br>\ <span id="form_notes_text">".$price_info."</span><br>\ <input class=\"form_notes_element\" type=\"text\" name=\"name2\" maxlength\"9\"><br><br>"; $mat2="<span id="form_notes_text">".$saved_info."</span><br>\ <input class=\"form_notes_element\" value="0" type="text" name="name" maxlength="9"><br><br>\ <span id="form_notes_text">".$price_info."</span><br>\ <input class=\"form_notes_element\" type=\"text\" name=\"name2\" maxlength\"9\"><br><br>"; echo "<span id=\"form_notes_text\">$add_title</span><br> <input class=\"form_notes_element\" type=\"text\" name=\"name\" maxlength=\"30\"><br><br> <span id=\"form_notes_text\">$material_type</span><br> <input type=\"radio\" name=\"type\" value=\"1\" checked onclick=\"document.getElementById('add_form').innerHTML = $mat1\">Value 1<br> <input type=\"radio\" name=\"type\" value=\"2\" onclick=\"document.getElementById('add_form).innerHTML = $mat2\">Value 2<br><br><br>"; But it doesn't work. What am I doing wrong? As a homework assignment, we are being asked to generate a table of images with at least 2 rows and 3 columns from an external javascript function. I've been trying to find some kind of javascript reference for this and I can't. I don't want someone to do it for me, but if I could get a basic example that would be great.
I have some HTML that I want to put in a Javascript file and reference the HTML through external Javascript file. So I have my page, example.html Code: <html> <head></head> <body> <script type="text/javascript src="../js/external.js"> </script> </body> </html> external.js Code: document.write("<p class="txt_medium style4"> example.com<br />101 Street St.<br />City, ST, ZIP</p><p class="txt_medium style4">"The Best website." </p>"); The above code is all on one line, but is not displaying on the page. PHP is out of the question too (_._) Any thoughts? I pulled this code from Google's example section to make markers on a v3 Google Maps API (I have added my own lat/long points and corresponding event listeners, of course, but this is still the spirit of the code):
Code: <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> var map; function initialize() { var map_center = new google.maps.LatLng(39.2,-84.479381); var store1 = new google.maps.LatLng(39.112456,-84.574779); var store2 = new google.maps.LatLng(39.314153,-84.261379); var store3 = new google.maps.LatLng(39.197099,-84.667579); var store4 = new google.maps.LatLng(39.16836,-84.479381); var myOptions = { zoom: 10, center: map_center, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var marker1 = new google.maps.Marker({ position: store1, map: map, title:"Store 1" }); var marker2 = new google.maps.Marker({ position: store2, map: map, title:"Store 2" }); var marker3 = new google.maps.Marker({ position: store3, map: map, title:"Store 3" }); var marker4 = new google.maps.Marker({ position: store4, map: map, title:"Store 4" }); google.maps.event.addListener(marker1, 'click', function() { map.set_center(store1); map.set_zoom(16); }); google.maps.event.addListener(marker2, 'click', function() { map.set_center(store2); map.set_zoom(16); }); google.maps.event.addListener(marker3, 'click', function() { map.set_center(store3); map.set_zoom(16); }); google.maps.event.addListener(marker4, 'click', function() { map.set_center(store4); map.set_zoom(16); }); } </script> This works without fail, but when I try to use a javascript array to hold my values and loop my way through the marker creation like so: Code: <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> var map; function initialize() { var map_center = new google.maps.LatLng(39.2,-84.479381); var store_locations = new Array(); var temporary_stuff = new Array(); store_locations[0] = "39.112456,-84.574779"; store_locations[1] = "39.314153,-84.261379"; store_locations[2] = "39.197099,-84.667579"; store_locations[3] = "39.16836,-84.479381"; var myOptions = { zoom: 10, center: map_center, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); for(i=0;i<store_locations.length;i++){ var marker_string = "position: "+new google.maps.LatLng(store_locations[i])+", map: map, title:\"Store "+(i+1)+"\";"; temporary_stuff[i] = new google.maps.Marker(marker_string); } var markers = new Array(); for(i=0;i<temporary_stuff.length;i++){ var the_marker = "position: temporary_stuff[" + i + "], map: map, title:\"Store " + (i+1) + "\";"; markers[i]= new google.maps.Marker(the_marker); } } </script> I get a blank map. Here's a link to the test file: http://rowsdower.freehostia.com/map_test.php It's not throwing up any errors in Firefox's developer or in IE but there it sits, a blank map. I'm sure this isn't clean or optimized code, but it looks correct to me. I've color-coded the code above to show what "for" loops are being used to try to replace which code. Hopefully that makes this more sensible. I haven't even tried to add the listeners yet since I can't get the markers to appear. Can anyone tell me why this isn't working or point me in a more productive direction? Is there a better way already out there that I haven't noticed? I have some code to pick a wire size and conduit size from 2 separate drop down list. Then inside the js it is evaluated to decide how many wires. My problem is I can't figure out how to make the drop down options go into the JS. I just put in an error alert to test if they were for now. Here is my code: Code: function fillcap(){ var wire = document.getElementById("wireSize"); var conduit = document.getElementById("conduitSize"); if (wire.option.length >= 10 && conduit.option.length == .5) { windows.alert("Wire Size exceeds conduit max fill!") } And the html Code: <h2>Fill Capacity</h2><br> <b>Wire Size</b><br> <select id ="wireSize"> <option value="1">#14</option> <option value="2">#12</option> <option value="3">#10</option> <option value="4">#8</option> <option value="5">#6</option> <option value="6">#4</option> <option value="7">#3</option> <option value="8">#2</option> <option value="9">#1</option> <option value="10">1/0</option> <option value="20">2/0</option> <option value="30">3/0</option> <option value="40">4/0</option> <option value="250">250</option> <option value="300">300</option> <option value="350">350</option> <option value="400">400</option> <option value="500">500</option> <option value="600">600</option> <option value="700">700</option> <option value="750">750</option> </select> <br> <b>Conduit Size</b><br> <select id="conduitSize"> <option value=".5">1/2</option> <option value=".75">3/4</option> <option value="1">1</option> <option value="1.25">1-1/4</option> <option value="1.5">1-1/2</option> <option value="2">2</option> <option value="2.5">2-1/2</option> <option value="3">3</option> <option value="3.5">3-1/2</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> </select><br> <input value="Wires allowed" onclick="fillcap()" type="button"> <input type="text" name="myresultbox" id="resultbox10"> Wires<br> Thank you for any advice. Hello all! I'm having a bit of an issue here with my lastest project. What I'm trying to do is have a menu that a user would click one of two links which would change the targeted iFrame, then repeat for two more options, and again for two more. It is essentially a filtering system for videos (the best way for you to see what I mean is to check out http://grph.cmwdesign.ca). My actual issue here is the changing of the iframe href, and on top of that, I seem to not to be able to properly get my functions to run all the time. Here is my Javascript: Code: var categoryLink=new Array(); var counter; var link = ""; categoryLink[0] = ""; categoryLink[1] = ""; categoryLink[2] = ""; counter = "0"; $(document).ready(function() { $(".atonal").live('click', function() { { alert("sometext"); if (categoryLink[0]=="") { categoryLink[0] = "atonal"; $("a.frame").attr('href', categoryLink[0] + categoryLink[1] + categoryLink[2]); else { categoryLink[0] = ""; $("a.frame").attr('href', categoryLink[0] + categoryLink[1] + categoryLink[2]); } }); }); $(document).ready(function() { $(".tonal").live('click', function() { alert("sometext"); if (categoryLink[0]=="") { categoryLink[0] = "tonal"; $("a.frame").attr('href', categoryLink[0] + categoryLink[1] + categoryLink[2]); else { categoryLink[0] = ""; $("a.frame").attr('href', categoryLink[0] + categoryLink[1] + categoryLink[2]); } }); }); $(document).ready(function() { $(".being").live('click', function() { alert("sometext"); categoryLink[1] = "being"; $("a.frame").attr('href', categoryLink[0] + categoryLink[1] + categoryLink[2]); if (categoryLink[1]=="") { categoryLink[1] = "being"; $("a.frame").attr('href', categoryLink[0] + categoryLink[1] + categoryLink[2]); else { categoryLink[1] = ""; $("a.frame").attr('href', categoryLink[0] + categoryLink[1] + categoryLink[2]); } }); }); $(document).ready(function() { $(".doing").live('click', function() { alert("sometext"); if (categoryLink[1]=="") { categoryLink[1] = "doing"; $("a.frame").attr('href', categoryLink[0] + categoryLink[1] + categoryLink[2]); else { categoryLink[1] = ""; $("a.frame").attr('href', categoryLink[0] + categoryLink[1] + categoryLink[2]); } }); }); $(document).ready(function() { $(".abstract").live('click', function() { alert("sometext"); if (categoryLink[2]=="") { categoryLink[2] = "abstract"; $("a.frame").attr('href', categoryLink[0] + categoryLink[1] + categoryLink[2]); else { categoryLink[2] = ""; $("a.frame").attr('href', categoryLink[0] + categoryLink[1] + categoryLink[2]); } }); }); $(document).ready(function() { $(".documentary").live('click', function() { alert("sometext"); if (categoryLink[2]=="") { categoryLink[2] = "documentary"; $("a.frame").attr('href', categoryLink[0] + categoryLink[1] + categoryLink[2]); else { categoryLink[2] = ""; $("a.frame").attr('href', categoryLink[0] + categoryLink[1] + categoryLink[2]); } }); }); and the HTML in question: Code: <table> <tr> <td height="35" width="210" valign="top">choose your sound</td> <td width="165" valign="top"><a href="#" id="atonal">atonal sounds</a></td> <td width="165" valign="top"><a href="#" id="tonal">tonal sounds</a></td> </tr> <tr> <td height="35" width="210" valign="top">choose your text</td> <td width="165" valign="top"><a href="#" id="being">being words</a></td> <td width="165" valign="top"><a href="#" id="doing">doing words</td> </tr> <tr> <td height="35" width="210" valign="top">choose your image</td> <td width="165" valign="top"><a href="#" id="abstract">abstract images</a></td> <td width="165" valign="top"><a href="#" id="documentary">documentary images</a></td> </tr> </table> I'm no Javascript wiz, so I'm sure I'm probably not going about this entirely the correct way. Any suggestions would be great! hi i am new to javascript. i want to make a form where a textarea, some buttons like bold,italic,link etc will be availablw. when user selecet some text from textarea and click bold button then one openig and closing tag will be added like this [sb]abc[/sb] how can i do this using javascript. any idea? pls. help if I have this inside TD tag Code: a<br>b what should I write instead ??? to reproduce new line in textarea Code: result = result.replace(/<br>/ig,"???") |