JavaScript - Saving Textarea Content As A File Issue
Hi everyone so ive been doing some searching on how to save textarea content as a file and found ...
Code: http://www.codingforums.com/showthread.php?t=32077 Saving works ok but the issue I have is that when you enter some text and hit the submit button the content of the page becomes the content within the the file your saving check demo so you can see for yourself: Code: http://6d8.info/demo.html So what I need is for the page to stay the same ie always demo.html with textarea and submit button and not the saving file content Any help is appretiated and as normal thank you in advance ... Similar TutorialsI'm trying to get this code to work in browsers other than IE. It prints the contents of a textarea, say, a notepad, first bringing up the print dialog. It does it with an (almost) invisible iframe. At first I thought it was only for IE, but I must have tested incorrectly (after a few dozen times uploading and printing out you lose your sanity) and I now see that it DOES work in FF, but not in Chrome. For me (and maybe others?) that is very good news because it will probably be easier for someone more knowledgeable than me to solve a Chrome problem rather than an "all other than IE" browsers problem. Code: /* for notepad printouts */ function printInput(f){ var ifr = window.frames['printFrame']; if (ifr){ //print the content of the invisible iframe ifr.document.getElementById('content').innerHTML=f.WRKNOTEPAD.value.replace(/\n/g,'<br />'); ifr.focus(); ifr.print(); } else { //print by opening a new window and then closing it var html='<html><head><style type="text/css">div{font:normal 14px Verdana}</style></head><body onload="window.print();window.close()"><div>'+f.WRKNOTEPAD.value.replace(/\n/g,'<br />');+'</div></body></html>' var win = window.open('','_blank','menubar,scrollbars,resizable'); win.document.open(); win.document.write(html); win.document.close(); } } function writeContent(objIframe){ var html='<html><head><style type="text/css">div{font:normal 14px Verdana}</style></head><body><div id="content"></div></body></html>' objIframe.document.write(html); objIframe.document.close(); } I think this bit: if (ifr) tests for IE and if it fails the condition, it dynamically creates a new window to print from. And I now see it does just this in FF. But not in Chrome. So narrowing it down I think the Chrome failure is in this bit: Code: else { //print by opening a new window and then closing it var html='<html><head><style type="text/css">div{font:normal 14px Verdana}</style></head><body onload="window.print();window.close()"><div>'+f.WRKNOTEPAD.value.replace(/\n/g,'<br />');+'</div></body></html>' var win = window.open('','_blank','menubar,scrollbars,resizable'); win.document.open(); win.document.write(html); win.document.close(); } Is there anyone who can see why this would fall over in Chrome? i want to assign content of textarea to a div .. like in twitter when you type something and press "Tweet" a div is created and has the content of textarea.. how can i implement it , i know something about getElementById() but not sure how it can help me here Hi I've just found out that a piece of code is not working as expected in certain browsers - but the way in which it goes wrong is not consistent, so maybe it's something wrong with my code. Oddly enough, it works exactly as I was expecting when viewed in IE. Here's the code... any help would be much appreciated. Thanks Code: <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> <script type="text/javascript"> function fillboxAddress() { if (document.getElementById('tbAddress').innerHTML == '') { document.getElementById('tbAddress').innerHTML = 'Address'; } } function clearboxAddress() { if (document.getElementById('tbAddress').innerHTML == 'Address') { document.getElementById('tbAddress').innerHTML = ''; } } </script> </head> <body> <p><textarea name="tbAddress" rows="2" cols="20" id="tbAddress" onfocus="clearboxAddress()" onblur="fillboxAddress()">Address</textarea></p> </body> Hello! I've been working with the Zurbs Foundation grid recently and they included a very nifty slider that works wonderfully, it has a lot of really neat support to it However when I implemented it the javascript is going back and resizing the height of the "content" div container that came stock with the slider. All of the code I'm using is 100% stock from Foundation, I'm working on a blank template at the moment in the javascript it edits the width & height to a height and width of 1px, so that if there is no content it will collapse. this is what that looks like below: Code: c=f.wrap('<div class="orbit-wrapper" />').parent();f.add(h).width("1px").height("1px") So I edited the width to include Code: .width("auto") I did this for the height as well, but it wasn't altering it so i gave it Code: .height("450px !important") (i usually don't use 'important', but i felt like I might be able to blow it out of the water and force it to be 450px tall). When I go to inspect the element it tells me that the height is 450px with an important tag attached to it, however there is still something overriding it Code: element.style{ height:468px; } the element.style means that a javascript file is the one that is overriding the current style. I'm struggling to find exactly where this is being called from. Any help would be greatly appreciated. Thanks! EDIT: Resolved! by adding Code: #featured a{height:450px;} to the css, it will fix the height (not fluid, but you can also do height:auto; and it will also work fine Hi all, I want to write i frame content to PDF file.Can any one help me how to do it Hello: I have a bit of an interesting delima: I have a form with select box which is dynamically db populated and based on the first selection, additional data populates two other linked boxes (a input and a textarea). This process happens in a table row. here is the source code of the selection process: PHP Code: <tr><td><select name='select_1' style='width:200px; color:#003399; text-align:center; font-size:1em' onChange="switch_select(); switch_text();"> <option>-- Select an Item --</option><option>5 A Series Blades</option><option>Balls</option><option>TT Tables-Mini</option><option>Bottle Water</option><option>TT Tables -- Reg</option><option>Gatorate</option><option>Blade combo</option><option>Membership Renewal</option><option>1 hr Private Lesson (Adlt)</option><option>1 hr Private Lesson (Chld)</option><option>Group Lesson (Adlt)</option><option>Group Lesson (Chlidren)</option><option>Membership (Couples-2)</option><option>Membership (Family -Up 4)</option><option>Robot Play</option><option>Gift Certificate</option><option>Gift Card Add Value</option><option>Club T-Shirts</option><option>Member Credit</option><option>Other</option><option>Rubber - 1615 PIPS </option><option>Rubber -Volant 3</option><option>6 A Series Blades</option><option>Blades Only -China QI</option><option>Blades Only -CQ 1</option><option>Ross-Action Blade</option><option>Ross-Classic Blade</option></select> </td> <select name='select_2' onChange="switch_text();" style='display:none' disabled='true'> <option>You need to select a category</option> <option></option> <option></option> </select><td><textarea name='mytextarea' rows='2' cols='40' class='expand10-1000' style='color:#003399; text-align:left; font-size:1.1em; border-left: none; border-right: none; border-bottom: none'></textarea><td> <td valign='top' width='17%'><input type='text' name='qty' class="qty" size='3' maxlength='3' value='' class='combo3' rel='code_id' title='' style='color:#003399; text-align:left; font-size:1.1em; border-left: none; border-right: none; border-bottom: none'></td> <td valign='top' width='17%'><input type='text' name='cost' class="cost" size='6' maxlength='6' value='0.00' class='combo3' rel='code_id' title='' style='color:#003399; text-align:left; font-size:1.1em; border-left: none; border-right: none; border-bottom: none'></td> </tr> The user has the option of adding an additional row which is similarily structured to give the user the option of selecting a different item (with its description an price) for each row. Now here is the problem; the adding row mechanism is done with ajax using the following code: PHP Code: $('#addrow').click(function(){ $('.item-row:last').after('[COLOR="Red"]//INSERT THE CONTENT OF THE PHP HERE//[/COLOR]'); if ($('.delete').length > 0) { $('.delete').show(); } bind(); }); I want to insert the content of an external php file containing the dynamic linked field into the ajax above in the section outlined in red. Sorry for the long post... here is the external php file: PHP Code: <?php echo" <script type='text/javascript' src='js/jquery-1.3.2.min.js'></script> <script language='JavaScript'> ";?> var num_of_cats = 17; // This is the number of categories, including the first, blank, category. var open_in_newwindow=1; //Set 1 to open links in new window, 0 for no. <?php include '../datalogin.php';// make sure this is available to make connection to db $result = mysql_query("SELECT * FROM products"); echo "var option_array = new Array(num_of_cats);"; $count=1; echo"option_array[0] = new Array(\"Please Select a Merchandise\");"; while($row = mysql_fetch_array($result)) { echo"option_array[".$count."] = new Array(\"--select One--\",\"\",\"\");"; $count++; } $result2 = mysql_query("SELECT * FROM products"); echo"var text_array = new Array(num_of_cats);"; $count=1; echo "text_array[0] = new Array(\"Please Select a Merchandise\");"; while($row_1 = mysql_fetch_array($result2)) { echo "text_array[".$count."] = new Array(\"".$row_1['product_desc']."\");"; $count++; } $result3 = mysql_query("SELECT * FROM products"); echo "var text_array2 = new Array(num_of_cats);"; $count=1; echo "text_array2[0] = new Array(\"Please Select a Merchandise\");"; while($row_2 = mysql_fetch_array($result3)) { echo "text_array2[".$count."] = new Array(\"".$row_2['unit_cost']."\");"; $count++; } ?> <?php echo" var options = 0; function switch_select() { for (loop = window.document.PaymentForm.select_2.options.length-1; loop > 0; loop--) { window.document.PaymentForm.select_2.options[loop] = null; } for (loop = 0; loop < option_array[window.document.PaymentForm.select_1.selectedIndex].length; loop++) { window.document.PaymentForm.select_2.options[loop] = new Option(option_array[window.document.PaymentForm.select_1.selectedIndex][loop]); } window.document.PaymentForm.select_2.selectedIndex = 0; } function switch_text() { window.document.PaymentForm.mytextarea.value = text_array[window.document.PaymentForm.select_1.selectedIndex][window.document.PaymentForm.select_2.selectedIndex]; window.document.PaymentForm.cost.value = text_array2[window.document.PaymentForm.select_1.selectedIndex][window.document.PaymentForm.select_2.selectedIndex]; //window.document.PaymentForm.gift_card.value = text_array3[window.document.PaymentForm.select_1.selectedIndex][window.document.PaymentForm.select_2.selectedIndex]; //window.document.PaymentForm.qty.value = text_array4[window.document.PaymentForm.select_1.selectedIndex][window.document.PaymentForm.select_2.selectedIndex]; } function box() { if (window.document.PaymentForm.select_2.selectedIndex == 0) { alert(\"Sorry, you have to select an item\"); } else { if (open_in_newwindow==1) window.open(url_array[window.document.PaymentForm.select_1.selectedIndex][window.document.PaymentForm.select_2.selectedIndex],\"_blank\"); else window.location=url_array[window.document.PaymentForm.select_1.selectedIndex][window.document.PaymentForm.select_2.selectedIndex] } } function set_orig() { window.document.PaymentForm.select_1.selectedIndex = 0; window.document.PaymentForm.select_2.selectedIndex = 0; } window.onload=set_orig </script> "; include '../datalogin.php'; $get_products = "select id as id_num, items as display_name2 from products order by id_num"; $get_products_res = mysql_query($get_products) or die (mysql_error()); if (mysql_num_rows($get_products_res) < 1) { // no records $display_block .="<p><em>Sorry, no records to select</em></p>"; } else { echo" <form name='PaymentForm' onSubmit='return false;'> <tr><td><select name='select_1' style='width:200px; color:#003399; text-align:center; font-size:1em' onChange=\"switch_select(); switch_text();\"> <option>-- Select an Item --</option>"; while ($recs2 = mysql_fetch_array($get_products_res)) { $id_num = $recs2['id_num']; $display_name2 = stripslashes($recs2['display_name2']); //$display_block .= "<option value=\"$id_num\">$display_name2</option>"; echo "<option>$display_name2</option>"; } } echo "</select> </td>"; echo " <select name='select_2' onChange=\"switch_text();\" style='display:none' disabled='true'> <option>You need to select a category</option> <option></option> <option></option> </select>"; echo"<td><textarea name='mytextarea' rows='2' cols='40' class='expand10-1000' style='color:#003399; text-align:left; font-size:1.1em; border-left: none; border-right: none; border-bottom: none'></textarea><td> <td valign='top' width='17%'><input type='text' name='qty' class=\"qty\" size='3' maxlength='3' value='' class='combo3' rel='code_id' title='' style='color:#003399; text-align:left; font-size:1.1em; border-left: none; border-right: none; border-bottom: none'></td> <td valign='top' width='17%'><input type='text' name='cost' class=\"cost\" size='6' maxlength='6' value='0.00' class='combo3' rel='code_id' title='' style='color:#003399; text-align:left; font-size:1.1em; border-left: none; border-right: none; border-bottom: none'></td> </tr> </form>"; ?> I hope this is doable and that I have describe my intention properly. Any thoughts would be appreciated! Mossa for some reason I am unable to read the file contents, or it could be something else, I added in some extra code to see where the script got to and I only get to see '1' on the output. Is there something else I have missed ? I am wanting to ready each line one by one and replace a phrase with another, then output the new line. I visit the 1.txt file in my browser and the file shows fine. var txtFile = new XMLHttpRequest(); txtFile.open("GET", "http://mysite.com/convertJS/1.txt", true); txtFile.onreadystatechange = function() { document.write("1<br>"); if (txtFile.readyState === 4) { // document is ready to parse. document.write("2<br>"); if (txtFile.status === 200) { // file is found document.write("3<br>"); allText = txtFile.responseText; lines = txtFile.responseText.split("\n"); document.write(lines + "<br>"); // I shall be altering the text in each line, search and replace, so only need to be able to read one line at a time. } } } txtFile.send(null); // close file. sorry that i used the quote method to post, but when i used [ code ] it corupted the text as the document . write lines?! Hi people, I would like to make the following thing: Load a random file, from a xml list, into a div. I've made a scheme where I show what I was trying to make, but I don't know how to make it. I would like to load into a div a random HTML file, loaded from a XML. Does anyone knows an similar example or can tell me how's possible to do this, please? is it better to do with Javascript ? thanks for the attention guys Good morning to all and thank you for sharing so much information to the non coding public. While browsing the javascriptkit.com site I came across a wonderful script to help me with pagination on a web page. The directions are simple to understand but one part has me lost. The files contentfader.js and jquery-1.2.2.pack.js are to be downloaded but where do I put them? Here is the page with the script: http://www.javascriptkit.com/script/...ntviewer.shtml I know everyone is busy and my question is basic but I have to start somewhere. Thanks, Hi all, this is the code I'm using in order to display the contents of an xml file into a page. It's working fine with IE but with Firefox. I have searched over intrenet and have applied all suggestions I've found about this issue. Unfortunately it's still not working. Can you please help me??? Code: function importXML() { if (document.implementation && document.implementation.createDocument) { xmlDoc = document.implementation.createDocument("", "", null); xmlDoc.onload = createTable; } else if (window.ActiveXObject) { xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.onreadystatechange = function () { if (xmlDoc.readyState == 4) createTable() }; } else { alert('Your browser can\'t handle this script'); return; } xmlDoc.load("news.xml"); } function createTable() { var x = xmlDoc.getElementsByTagName('event'); var newEl = document.createElement('table'); newEl.style.width = '100%'; newEl.setAttribute('cellPadding',0); newEl.setAttribute('cellspacing',0); var tmp = document.createElement('TBODY'); newEl.appendChild(tmp); for (i=0;i<x.length;i++) { var row = document.createElement('TR'); if (x[i].childNodes[0].nodeType != 1) continue; var container = document.createElement('<TD style="padding-left:3px; font-weight:bold;">'); var theData = document.createTextNode(x[i].childNodes[0].firstChild.nodeValue); container.appendChild(theData); row.appendChild(container); tmp.appendChild(row); row = document.createElement('TR'); if (x[i].childNodes[1].nodeType != 1) continue; var container = document.createElement('<TD class="box_2">'); var theData = document.createTextNode(x[i].childNodes[1].firstChild.nodeValue); container.appendChild(theData); row.appendChild(container); tmp.appendChild(row); } document.getElementById('writeroot').appendChild(newEl); } I would like to ask is it posible to add text from a text file to a text area on a page.. Philp if you read this i am not asking for a javascript code i am asking wether or not it can be done. P.s if your a nice person like philp is not and you want to private message me if you have one I'm trying to code something in batch and i need some help... I need to change the batch files dir to the only folder in the next folder IE: move from folder 1 to folder 2 contents of folder 1: folder 2 however i don't know the real name of folder 2 so I need batch file to like pick the folder by its number or something.... is there a solution(i would like to code this in batch) I have an Extjs web app that's running on a spring/rest backend & I'm having a really strange caching issue with my web app's javascript files & no-one seems to be able to tell what it is. The issue is that I have deleted a section of code in the JS file, yet it's still appearing in the browser, both IE and FF. I have tried a number of solutions but nothing has worked. if anyone has any suggestions as to what the issue would be, I would appreciate it. What I have tried: Manually remove & re-add the file Rollback the file to a previous version Remove the file from the index.html and re-add it Clear all cache in FF & IE Disable firebug Check the script is updated by manually accessing the file via the application URL & Firebug Script tab Renaming the JS file Renaming the index.html file Cleaning/rebuilding/removing the project Restarting the server & eclipse Pointing the server to a different location Rebooting Removing & re-adding the Tomcat server Ctrl + F5 Checking the URL path/classpath in Eclipse is correct Removing all Temp Internet Files (including when all associated apps were closed) Adding Pragma no-cache metadata tag to the index.html I'm at a loss as to what could be causing it. Hello Everyone... I'm VERY new to JS and trying to learn using a program that creates menus with Flash and JS. With the below code, my flash menu works when the files are in the same directory as the code, however, I cannot figure out how to make it work when I have the XML,Flash,JS files located in another directory. Could someone give me idea what I must first look at. I believe I have tried the obvious areas in the code, but they have not worked. Thanks ! <script type="text/javascript" src="stfmenu.js"></script> <p><a href="http://www.menu-flash.com" style="display:none;visibility:hidden;"> Flash Menu</a></p> <script type="text/javascript"> <!-- st_siteroot="" st_swfpath="menu.swf"; o={} o.position="static"; o.clear ="both"; o.width ="1"; o.height = "1"; o.left = "1"; o.top = "1"; o.id = "Adin"; if(!window.location.href.indexOf("file:") && st_swfpath.charAt(0)=="/") o.src = st_siteroot+st_swfpath; else o.src = st_swfpath; o.vars="flashid=Adin&menuId=0&dirPath=&siteRoot="; document.write(SFMGetFlashHTML(o)); //--> </script> Hi, I'm trying to call a Js function from a test.js located in a HTML file. I'm getting error message "Object has no method..." in Chrome. But no issues are seen in Firefox. Can any one please let me know how i can fix this. <html> <head> .... .... .... <div> <html> <head> <script src="test.js"></script> <script> function aFunc() { alert ("Inside aFunc"); } </script> </head> <body> </html> .... .... .... </div> </head> </html> test.js function bFunc () { aFunc (); } Hi i have a problem, i've been trying to fix this for the whole day pls see my code below Code: for ($o = 0; $o <= $totalclass; $o++) { for($i = 1; $i <= 45; $i++) { if ($_SESSION['classification'][$o] == $i) { $sql2="SELECT ClassDesc FROM tblclass WHERE ClassID = '$i'"; $result2=mysql_query($sql2); // If successfully queried if($result2) { while ($row2 = mysql_fetch_assoc($result2)) { $ClassDesc2 = $row2['ClassDesc']; } } //echo $ClassDesc2; ?> <tr> <td bgcolor="FAFAF6" class="small" valign="top">Class <? echo $i; ?></td> <input type="hidden" name="<? echo "classid[]"; ?>" value="<? echo $i; ?>"> <td bgcolor="FAFAF6"> <textarea name="<? echo "specification[]"; ?>" COLS="50" ROWS="6" class="small" wrap="virtual" tabindex="<? echo $i; ?>"><? echo $ClassDesc2;?></textarea> <input type="button" value="Reset" onclick="window.reset();" name="reset"> </td> </tr> <? } } } i've trying to create a button or image to reset one textarea (from whole array) and so far i've been unsuccessful. i've seen this on other website and i know it is possible to do this, pls help! I have a problem with this code. i want to save the result drawing to the database using php as binary format. but i dont know how, can you help me with this. below is my code Code: <div style="width:225px; padding-top:60px; height:452px; margin:0px auto; text-align:center; background:url(template/premium/img/guild.gif) no-repeat top center;"> <form action="" method="post" onsubmit="request('crgild','sh_','POST','index.php'); return false;" id="crgild"> Select Character: <select name="character"> <option value="[ASSASSIN]">[ASSASSIN]</option></select><br><br>NAME: <input class="txt-input" type="text" maxlength="10" name="guildname"><br> <div style="margin:10px;"><div class="guild-top-left2" style="background-color:#000000;"></div> <div class="guild-top-right2" style="background-color:#000000;"></div><div class="guild-top-center2" style="background-color:#000000;"></div> <div class="guild-center-left" style="background-color:#000000;"><div class="guild-center-right"> <table style="width: 150px; height:150px" align=center cellpadding=0 cellspacing=1><tr> <td onclick="addcolor(1);" id="gimage1" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[1]" id="poscolor[1]" value="0"></td> <td onclick="addcolor(2);" id="gimage2" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[2]" id="poscolor[2]" value="0"></td> <td onclick="addcolor(3);" id="gimage3" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[3]" id="poscolor[3]" value="0"></td> <td onclick="addcolor(4);" id="gimage4" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[4]" id="poscolor[4]" value="0"></td> <td onclick="addcolor(5);" id="gimage5" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[5]" id="poscolor[5]" value="0"></td> <td onclick="addcolor(6);" id="gimage6" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[6]" id="poscolor[6]" value="0"></td> <td onclick="addcolor(7);" id="gimage7" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[7]" id="poscolor[7]" value="0"></td> <td onclick="addcolor(8);" id="gimage8" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[8]" id="poscolor[8]" value="0"></td></tr> <tr><td onclick="addcolor(9);" id="gimage9" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[9]" id="poscolor[9]" value="0"></td> <td onclick="addcolor(10);" id="gimage10" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[10]" id="poscolor[10]" value="0"></td> <td onclick="addcolor(11);" id="gimage11" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[11]" id="poscolor[11]" value="0"></td> <td onclick="addcolor(12);" id="gimage12" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[12]" id="poscolor[12]" value="0"></td> <td onclick="addcolor(13);" id="gimage13" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[13]" id="poscolor[13]" value="0"></td> <td onclick="addcolor(14);" id="gimage14" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[14]" id="poscolor[14]" value="0"></td> <td onclick="addcolor(15);" id="gimage15" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[15]" id="poscolor[15]" value="0"></td> <td onclick="addcolor(16);" id="gimage16" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[16]" id="poscolor[16]" value="0"></td></tr> <tr><td onclick="addcolor(17);" id="gimage17" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[17]" id="poscolor[17]" value="0"></td> <td onclick="addcolor(18);" id="gimage18" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[18]" id="poscolor[18]" value="0"></td> <td onclick="addcolor(19);" id="gimage19" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[19]" id="poscolor[19]" value="0"></td> <td onclick="addcolor(20);" id="gimage20" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[20]" id="poscolor[20]" value="0"></td> <td onclick="addcolor(21);" id="gimage21" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[21]" id="poscolor[21]" value="0"></td> <td onclick="addcolor(22);" id="gimage22" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[22]" id="poscolor[22]" value="0"></td> <td onclick="addcolor(23);" id="gimage23" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[23]" id="poscolor[23]" value="0"></td> <td onclick="addcolor(24);" id="gimage24" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[24]" id="poscolor[24]" value="0"></td></tr> <tr><td onclick="addcolor(25);" id="gimage25" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[25]" id="poscolor[25]" value="0"></td> <td onclick="addcolor(26);" id="gimage26" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[26]" id="poscolor[26]" value="0"></td> <td onclick="addcolor(27);" id="gimage27" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[27]" id="poscolor[27]" value="0"></td> <td onclick="addcolor(28);" id="gimage28" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[28]" id="poscolor[28]" value="0"></td> <td onclick="addcolor(29);" id="gimage29" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[29]" id="poscolor[29]" value="0"></td> <td onclick="addcolor(30);" id="gimage30" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[30]" id="poscolor[30]" value="0"></td> <td onclick="addcolor(31);" id="gimage31" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[31]" id="poscolor[31]" value="0"></td> <td onclick="addcolor(32);" id="gimage32" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[32]" id="poscolor[32]" value="0"></td></tr> <tr><td onclick="addcolor(33);" id="gimage33" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[33]" id="poscolor[33]" value="0"></td> <td onclick="addcolor(34);" id="gimage34" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[34]" id="poscolor[34]" value="0"></td> <td onclick="addcolor(35);" id="gimage35" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[35]" id="poscolor[35]" value="0"></td> <td onclick="addcolor(36);" id="gimage36" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[36]" id="poscolor[36]" value="0"></td> <td onclick="addcolor(37);" id="gimage37" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[37]" id="poscolor[37]" value="0"></td> <td onclick="addcolor(38);" id="gimage38" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[38]" id="poscolor[38]" value="0"></td> <td onclick="addcolor(39);" id="gimage39" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[39]" id="poscolor[39]" value="0"></td> <td onclick="addcolor(40);" id="gimage40" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[40]" id="poscolor[40]" value="0"></td></tr> <tr><td onclick="addcolor(41);" id="gimage41" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[41]" id="poscolor[41]" value="0"></td> <td onclick="addcolor(42);" id="gimage42" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[42]" id="poscolor[42]" value="0"></td> <td onclick="addcolor(43);" id="gimage43" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[43]" id="poscolor[43]" value="0"></td> <td onclick="addcolor(44);" id="gimage44" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[44]" id="poscolor[44]" value="0"></td> <td onclick="addcolor(45);" id="gimage45" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[45]" id="poscolor[45]" value="0"></td> <td onclick="addcolor(46);" id="gimage46" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[46]" id="poscolor[46]" value="0"></td> <td onclick="addcolor(47);" id="gimage47" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[47]" id="poscolor[47]" value="0"></td> <td onclick="addcolor(48);" id="gimage48" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[48]" id="poscolor[48]" value="0"></td></tr> <tr><td onclick="addcolor(49);" id="gimage49" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[49]" id="poscolor[49]" value="0"></td> <td onclick="addcolor(50);" id="gimage50" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[50]" id="poscolor[50]" value="0"></td> <td onclick="addcolor(51);" id="gimage51" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[51]" id="poscolor[51]" value="0"></td> <td onclick="addcolor(52);" id="gimage52" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[52]" id="poscolor[52]" value="0"></td> <td onclick="addcolor(53);" id="gimage53" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[53]" id="poscolor[53]" value="0"></td> <td onclick="addcolor(54);" id="gimage54" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[54]" id="poscolor[54]" value="0"></td> <td onclick="addcolor(55);" id="gimage55" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[55]" id="poscolor[55]" value="0"></td> <td onclick="addcolor(56);" id="gimage56" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[56]" id="poscolor[56]" value="0"></td></tr> <tr><td onclick="addcolor(57);" id="gimage57" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[57]" id="poscolor[57]" value="0"></td> <td onclick="addcolor(58);" id="gimage58" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[58]" id="poscolor[58]" value="0"></td> <td onclick="addcolor(59);" id="gimage59" style="border:1px solid #555555; cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"> <input type="hidden" name="poscolor[59]" id="poscolor[59]" value="0"></td> </tr> <tr></table></div></div> <div class="guild-bottom-left" style="background-color:#000000;"></div><div class="guild-bottom-right" style="background-color:#000000;"></div> <div class="guild-bottom-center" style="background-color:#000000;"></div></div> <div id="currentcolor2" style="width:15px; float:left; margin-left:30px; height:15px; border:1px solid #555555; background:url(template/premium/img/guild-back.gif);"></div> <div style="float:feft; text-align:left; margin-left:50px; margin-right:20px;">After selecting a color with the mouse, please draw.</div><br> <table align=center cellpadding=0 cellspacing=0 border=1><tr> <td onclick="changecolor(this.style.background,0)" style="cursor:pointer; background:url(template/premium/img/guild-back.gif);" width="15" height="15"></td> <td onclick="changecolor(this.style.background,1)" style="cursor:pointer; background:#000000;" width="15" height="15"></td> <td onclick="changecolor(this.style.background,2)" style="cursor:pointer; background:#8c8a8d;" width="15" height="15"></td> <td onclick="changecolor(this.style.background,3)" style="cursor:pointer; background:#ffffff;" width="15" height="15"></td> <td onclick="changecolor(this.style.background,4)" style="cursor:pointer; background:#fe0000;" width="15" height="15"></td> <td onclick="changecolor(this.style.background,5)" style="cursor:pointer; background:#ff8a00;" width="15" height="15"></td> <td onclick="changecolor(this.style.background,6)" style="cursor:pointer; background:#ffff00;" width="15" height="15"></td> <td onclick="changecolor(this.style.background,7)" style="cursor:pointer; background:#8cff01;" width="15" height="15"></td></tr> <tr><td onclick="changecolor(this.style.background,8)" style="cursor:pointer; background:#00ff00;" width="15" height="15"></td> <td onclick="changecolor(this.style.background,9)" style="cursor:pointer; background:#01ff8d;" width="15" height="15"></td> <td onclick="changecolor(this.style.background,'A')" style="cursor:pointer; background:#00ffff;" width="15" height="15"></td> <td onclick="changecolor(this.style.background,'B')" style="cursor:pointer; background:#008aff;" width="15" height="15"></td> <td onclick="changecolor(this.style.background,'C')" style="cursor:pointer; background:#0000fe;" width="15" height="15"></td> <td onclick="changecolor(this.style.background,'D')" style="cursor:pointer; background:#8c00ff;" width="15" height="15"></td> <td onclick="changecolor(this.style.background,'E')" style="cursor:pointer; background:#ff00fe;" width="15" height="15"></td> <td onclick="changecolor(this.style.background,'F')" style="cursor:pointer; background:#ff008c;" width="15" height="15"></td> </tr></table> <input type="hidden" id="currentcolor" value=""><br><br> <input class="guild-submit" name="createguild" type="submit" value="Create"></form></div> <script type="text/javascript"> function changecolor(color,encode) { document.getElementById('currentcolor').value=encode; document.getElementById('currentcolor2').style.background=color; } function addcolor(id) { document.getElementById('poscolor['+id+']').value=document.getElementById('currentcolor').value; document.getElementById('gimage'+id).style.background=document.getElementById('currentcolor2').style.background; } </script> <input type="hidden" id="new_credits" value="0"> hello people! i would like to ask if someone can help me code a couple of scripts for saving various data into cookies, and then post them to e-mail through a cgi script. to be more clear, i want to save some questionare's answers given through a series of html pages, to cookies. when (and if) the last question is answered, send all the answers to an e-mail address. thanks! Is there any possible way for JS to save changes that a user has made? my situation is that I'm a photographer who offers photobooks. My customers often have hundreds or thousands of photos and want captions on lots of them. I want to post a photo gallery with a user input form. I've created a simple form, but I want the user to be able to save comments straight to the gallery so I can look at them... it's only a very simple form and isn't quite finished yet, oh by the way, I'm not sure how to use the check box... but, i'll work on that. Code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> <style type="text/css"> <!-- #divWrapper { text-align: center; width: 430px; margin-right: auto; margin-left: auto; } --> </style> </head> <body> <script type="text/javascript"> function picForm() { if(document.frmInput.addPic.value="yes") { document.frmOutput.outChoice.value="will" } else { document.frmOutput.outChoice.value="will NOT" } document.frmOutput.outCap.value=document.frmInput.addCap.value; document.frmOutput.outComm.value=document.frmInput.addComm.value; } </script> <div id="divWrapper"> <p>Uncheck the box if you do NOT want this photo to appear in your photobook. Please write your caption in the box provided. Any further comments you wish to make can be entered in the second box.</p> <div id="divInput"> <form name="frmInput"> <table id="tblForm" cellpadding="3px"> <tr> <td><input name="addPic" type="checkbox" value="yes"> Add to Photobook</td> <td> </td> </tr> <tr> <td>Caption<br> <textarea name="addCap" cols="24" rows="3" value="...Add Caption Here..."></textarea></td> <td>Comments<br> <textarea name="addComm" cols="24" rows="3" value="...Add Comments Here..."></textarea></td> </tr> <tr> <td></td> <td><div align="right"> <input name="btnSubmit" type="button" value="Submit" onClick="picForm()" /> </div></td> </tr> </table> </form> </div> <div id="divOutput"> <form name="frmOutput"> <p>This photo <input name="outChoice" type="text" value="" size="7" style="border:0px" /> appear in your photo book.</p> <p>You would like the caption to read: <input name="outCap" type="text" value="" size="50" style="border:0px" /> </p> <p>Your comments to us a <input name="outComm" type="text" value="" size="50" style="border:0px" /> </p> </form> </div> </div> </body> </html> Please help! |