JavaScript - What Html / Javascript Tag / Code Do I Use To Render Html Instead Of Html Syntax?
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! Similar TutorialsIf 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'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? 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'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> 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! Hello, this is my first post. I've been looking for a script to render HTML code into an accurate PNG file. I found this kind of function at http://www.mecabricks.com/en/workshop/ - when pressing the camera button. And also http://html2canvas.hertzen.com/ - but the documentation is not enough so I just can't get it to work... I was wondering if anyone could help me to get it going? Kind regards, P First of all I'm a new user and I'm not a HTML/js expert so I'd be very grateful if someone could help me how to fix the below code in order to be able to expand Menu2 ? Code: <script> function expandCollapselapse(showHide) { var hideShowDiv = document.getElementById(showHide); var label = document.getElementById("expand"); if (hideShowDiv.style.display == 'none') { label.innerHTML = label.innerHTML.replace("[+]", "[-]"); hideShowDiv.style.display = 'block'; } else { label.innerHTML = label.innerHTML.replace("[-]", "[+]"); hideShowDiv.style.display = 'none'; } } </script> <div> <table style="width: 500px;" align="left"> <tr> <td onclick="expandCollapse('showHide');" id="expand"><b>[+] Menu1</b></td> </tr> </table> </div> <br><br> <div id="showHide" style="display: none;"> <table style="width: 500px;" align="left"> <tr> <td>Start Date</td> <td>End Date</td> <td>Amount</td> </tr> <tr> <td>06/05/2013</td> <td>06/05/2013</td> <td>1000</td> </tr> <tr> <td>06/05/2013</td> <td>06/05/2013</td> <td>1000</td> </tr> <tr> <td>06/05/2013</td> <td>06/05/2013</td> <td>1000</td> </tr> </table> </div> <br><br> <div> <table style="width: 500px;" align="left"> <tr> <td onclick="expandCollapse('showHide');" id="expand"><b>[+] Menu2</b></td> </tr> </table> </div> <br><br> <div id="showHide" style="display: none;"> <table style="width: 500px;" align="left"> <tr> <td>Start Date</td> <td>End Date</td> <td>Amount</td> </tr> <tr> <td>06/05/2013</td> <td>06/05/2013</td> <td>1000</td> </tr> <tr> <td>06/05/2013</td> <td>06/05/2013</td> <td>1000</td> </tr> <tr> <td>06/05/2013</td> <td>06/05/2013</td> <td>1000</td> </tr> </table> </div> Many thanks for your time and help! Cheers, Hi, I'm just now starting to try to insert some javascript into my html and php code. I'm only used to working with those two markups. I need to try some very simple javascript snippets in some forms I'm making, but am having an issue getting the code to work. When I find these snippets, they are usually in a format like this: Code: <SCRIPT LANGUAGE="JavaScript"> // functions and whatnot here function makeSomethingHappen(field, count, max) { if (something.works > true) field.value = i.will.crap(0, max); else // calculate the remaining characters field.value = max - more.nodoze.caffein; } </script> <center> <form name=sample action=""> <input type="text" name="hours"> onKeyDown="CountLeft(some.js.looking,stuff.here);" onKeyUp="CountLeft(some.more.js.looking,stuff.here);"> </form> I've tried inserting the stuff like the webpages have it listed. I also try inserting everything contained in the <script> tags into the head of the document (or creating a head and putting it in there, since all my stuff is php and html code called to the file with php includes and whatnot). Anyways, I hoping somebody can provide a pointer as to how to use these snippets or how to correctly place things like this. I'm assuming there's a relatively uniform way that people are posting their tiny little js codes and I'm missing some basic knowledge as to how to use it. Any help is greatly appreciated. Two things: I'm making a website for my online portfolio for Uni... 1. I want to make a prev|next (preferably with the numbers after too if possible) to flick through my work so I don't have to scroll around the page. 2. I want to create a slide down menu that stays open when an option is selected. Hope I've explained it well! Thanks in advance It's a sort of mad lib. I have written codes for both windows. I just don't know what code to write in, or outside the tellStory function to display the actual story once the other window is called open.... <html> <head> <title>Silly Storey About You</title> </head> <script> function tellStorey() { setupStoryWindow(); } function setupStoryWindow(name, contentString) { var header = "<head><title>" + name + " 's story</title><head>" + "<h1>" + name + " 's story</h1>"; var storyWindow = window.open('', 'storyWindow'); storyWindow.document.write(header); storyWindow.document.write(contentString); storyWindow.document.close(); storyWindow.focus(); } </script> <body> <h1>Tell Your Storey</h1> <form name="input" method="get"> <p>Your first name: <input type="text" name="yourFirstName" /></p> <p>Your gender: <select name=yourGenderList> <option value="girl">girl <option value="guy">guy </select></p> <p>City you'd like to visit some day: <input type="text" name="city"/></p> <p>A fruit (plural form): <input type="text" name="fruit"/></p> <p>Your favorite teacher's name: <input type="text" name="teacher" /></p> <p>Your best friend's name: <input type="text" name="friend" /></p> <p>Your favorite actor's name: <input type="text" name="actor" /></p> <p>A large animal: <input type="text" name="animal" /></p> <p><input type=button value="Tell a Storey" onclick='tellStorey();'</p> </form> </body> </html> //here's the story "One fine morning on valentine's day a" + yourGenderList + "named" + yourFirstName + "woke up so excited. For today was going to be a single's date night in" + city + ", which is well known for "+ fruit + "." + name + "'s friend" + friend + "recommended that I go because they ended up, curiously enough, meeting and marrying my high school teacher" + teacher + ". I'm just hoping to meet someone that looks like" + actor + ". I've had a crush on"+ actor + "for too many years now. Well, realistically, that probably won't happen, but as long as they look like a" + animal + ", then my night will be worth while!" Help with JavaScript in HTML? Okay, I have done everything that I can to try and figure this one out...I am stumped. I need to display the flag of the specific country when the radio button of that flag is clicked. The book states: Create a Web Page that contains a table with two columns in a single row. In the first column, create a list of radio buttons that contains the name of each of the 10 countries. In the second column, display the flag of the selected country in an anchor element. Use onclick even handlers to display the flag image for each selected country. When the page first loads, the image should be blank. Here is my code: Code: <!DOCTYPE HTML> <!--My Name--> <!--Chapter 8 Page 478--> <!--October 28, 2011--> <html> <head> <title>Country Flags</title> <script type="text/javascript"> /* <![CDATA[ */ var argentina = "argentina.jpg" var australia = "australia.jpg" var bolivia = "bolivia.jpg" var cuba = "cuba.jpg" var finland = "finland.jpg" var france = "france.jpg" var italy = "italy.jpg" var peru = "peru.jpg" var syria = "syria.jpg" var tunisia = "tunisia.jpg" /* ]] */ </script> </head> <body> <form name="flags" action=" " method="get"> <table style="border: 1; width: 100%"> <tr valign="top"> <td> <input type="radio" name="flags" onclick= "document.argentina.jpg" /> Argentina <input type="radio" name="flags" onclick= "document.flags.country.value=austra… /> Australia <input type="radio" name="flags" onclick= "document.flags.country.value=bolivi… /> Bolivia <input type="radio" name="flags" onclick= "document.flags.country.value=cuba" /> Cuba <input type="radio" name="flags" onclick= "document.flags.country.value=finlan… /> Finland <input type="radio" name="flags" onclick= "document.flags.country.value=france… /> France <input type="radio" name="flags" onclick= "document.flags.country.value=italy" /> Italy <input type="radio" name="flags" onclick= "document.flags.country.value=peru" /> Peru <input type="radio" name="flags" onclick= "document.flags.country.value=syria" /> Syria <input type="radio" name="flags" onclick= "document.flags.country.value=tunisi… /> Tunisia </td> </p> <td> <textarea name="country" cols="75" rows="20" style="background-color: Transparent; border: none; overflow: hidden"></textarea> </td> </tr> </table> </form> </p> </body> </html> Can someone please help me out here. Thanks I am making an webpage where you get two random photos and you click using the arrow keys which one you like best and that one stays and goes on the versus the next random photo. I got it so far when you start the page it sets two random pictures but i dont know how to do key inputs on html Code: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>Which Is better?</title> <h1 align = center>Which is better?</h1> <script language="JavaScript"> var theImages = new Array() var thePictures = new Array() thePictures[1] = 'untitled-1.jpg' thePictures[2] = 'untitled-2.jpg' thePictures[3] = 'untitled-3.jpg' thePictures[4] = 'untitled-4.jpg' thePictures[5] = 'untitled-5.jpg' thePictures[6] = 'untitled-6.jpg' thePictures[7] = 'untitled-7.jpg' thePictures[8] = 'untitled-8.jpg' thePictures[9] = 'untitled-9.jpg' thePictures[10] = 'untitled-10.jpg' thePictures[11] = 'untitled-11.jpg' thePictures[12] = 'untitled-12.jpg' thePictures[13] = 'untitled-13.jpg' thePictures[14] = 'untitled-14.jpg' thePictures[15] = 'untitled-15.jpg' thePictures[16] = 'untitled-16.jpg' thePictures[17] = 'untitled-17.jpg' thePictures[18] = 'untitled-18.jpg' thePictures[19] = 'untitled-19.jpg' thePictures[20] = 'untitled-20.jpg' thePictures[21] = 'untitled-21.jpg' thePictures[22] = 'untitled-22.jpg' thePictures[23] = 'untitled-23.jpg' thePictures[24] = 'untitled-24.jpg' thePictures[25] = 'untitled-25.jpg' thePictures[26] = 'untitled-26.jpg' thePictures[27] = 'untitled-27.jpg' thePictures[28] = 'untitled-28.jpg' thePictures[29] = 'untitled-29.jpg' thePictures[30] = 'untitled-30.jpg' thePictures[31] = 'untitled-31.jpg' thePictures[32] = 'untitled-32.jpg' thePictures[33] = 'untitled-33.jpg' thePictures[34] = 'untitled-34.jpg' thePictures[35] = 'untitled-35.jpg' thePictures[36] = 'untitled-36.jpg' thePictures[37] = 'untitled-37.jpg' thePictures[38] = 'untitled-38.jpg' thePictures[39] = 'untitled-39.jpg' thePictures[40] = 'untitled-40.jpg' thePictures[41] = 'untitled-41.jpg' thePictures[42] = 'untitled-42.jpg' thePictures[43] = 'untitled-43.jpg' thePictures[44] = 'untitled-44.jpg' thePictures[45] = 'untitled-45.jpg' thePictures[46] = 'untitled-46.jpg' thePictures[47] = 'untitled-47.jpg' thePictures[48] = 'untitled-48.jpg' thePictures[49] = 'untitled-49.jpg' thePictures[50] = 'untitled-50.jpg' thePictures[51] = 'untitled-51.jpg' thePictures[52] = 'untitled-52.jpg' thePictures[53] = 'untitled-53.jpg' thePictures[54] = 'untitled-54.jpg' thePictures[55] = 'untitled-55.jpg' thePictures[56] = 'untitled-56.jpg' thePictures[57] = 'untitled-57.jpg' thePictures[58] = 'untitled-58.jpg' thePictures[59] = 'untitled-59.jpg' thePictures[60] = 'untitled-60.jpg' thePictures[61] = 'untitled-61.jpg' thePictures[62] = 'untitled-62.jpg' thePictures[63] = 'untitled-63.jpg' thePictures[64] = 'untitled-64.jpg' thePictures[65] = 'untitled-65.jpg' thePictures[66] = 'untitled-66.jpg' thePictures[67] = 'untitled-67jpg' thePictures[68] = 'untitled-68.jpg' thePictures[69] = 'untitled-69.jpg' thePictures[70] = 'untitled-70.jpg' thePictures[71] = 'untitled-71.jpg' thePictures[72] = 'untitled-72.jpg' thePictures[73] = 'untitled-73.jpg' thePictures[74] = 'untitled-74.jpg' thePictures[75] = 'untitled-1.jpg' thePictures[76] = 'untitled-2.jpg' thePictures[77] = 'untitled-77.jpg' thePictures[78] = 'untitled-78.jpg' thePictures[79] = 'untitled-79.jpg' thePictures[80] = 'untitled-80.jpg' thePictures[81] = 'untitled-81.jpg' thePictures[82] = 'untitled-82.jpg' thePictures[83] = 'untitled-83.jpg' thePictures[84] = 'untitled-84.jpg' thePictures[85] = 'untitled-85.jpg' thePictures[86] = 'untitled-86.jpg' thePictures[87] = 'untitled-87.jpg' thePictures[88] = 'untitled-88.jpg' thePictures[89] = 'untitled-89.jpg' thePictures[90] = 'untitled-90.jpg' thePictures[91] = 'untitled-91.jpg' thePictures[92] = 'untitled-92.jpg' thePictures[93] = 'untitled-93.jpg' thePictures[94] = 'untitled-94.jpg' thePictures[95] = 'untitled-95.jpg' thePictures[96] = 'untitled-96.jpg' thePictures[97] = 'untitled-97.jpg' thePictures[98] = 'untitled-98.jpg' thePictures[99] = 'untitled-99.jpg' thePictures[100] = 'untitled-100.jpg' thePictures[101] = 'untitled-101.jpg' thePictures[102] = 'untitled-102.jpg' thePictures[103] = 'untitled-103.jpg' thePictures[104] = 'untitled-104.jpg' thePictures[105] = 'untitled-105.jpg' thePictures[106] = 'untitled-106.jpg' thePictures[107] = 'untitled-107.jpg' thePictures[108] = 'untitled-108.jpg' thePictures[109] = 'untitled-109.jpg' thePictures[110] = 'untitled-110.jpg' thePictures[111] = 'untitled-111.jpg' thePictures[112] = 'untitled-112.jpg' thePictures[113] = 'untitled-113.jpg' thePictures[114] = 'untitled-114.jpg' thePictures[115] = 'untitled-115.jpg' thePictures[116] = 'untitled-116.jpg' thePictures[117] = 'untitled-117.jpg' thePictures[118] = 'untitled-118.jpg' thePictures[119] = 'untitled-119.jpg' thePictures[120] = 'untitled-120.jpg' thePictures[121] = 'untitled-121.jpg' thePictures[122] = 'untitled-122.jpg' thePictures[123] = 'untitled-123.jpg' thePictures[124] = 'untitled-124.jpg' thePictures[125] = 'untitled-125.jpg' thePictures[126] = 'untitled-126.jpg' thePictures[127] = 'untitled-127.jpg' thePictures[128] = 'untitled-128.jpg' thePictures[129] = 'untitled-129.jpg' thePictures[130] = 'untitled-130.jpg' thePictures[131] = 'untitled-131.jpg' thePictures[132] = 'untitled-132.jpg' thePictures[133] = 'untitled-133.jpg' thePictures[134] = 'untitled-134.jpg' thePictures[135] = 'untitled-135.jpg' thePictures[136] = 'untitled-136.jpg' thePictures[137] = 'untitled-137.jpg' thePictures[138] = 'untitled-138.jpg' thePictures[139] = 'untitled-139.jpg' thePictures[140] = 'untitled-140.jpg' thePictures[141] = 'untitled-141.jpg' thePictures[142] = 'untitled-142.jpg' thePictures[143] = 'untitled-143.jpg' thePictures[144] = 'untitled-144.jpg' thePictures[145] = 'untitled-145.jpg' thePictures[146] = 'untitled-146.jpg' thePictures[147] = 'untitled-147.jpg' thePictures[148] = 'untitled-148.jpg' thePictures[149] = 'untitled-149.jpg' thePictures[150] = 'untitled-150.jpg' theImages[1] = 'untitled-1.jpg' theImages[2] = 'untitled-2.jpg' theImages[3] = 'untitled-3.jpg' theImages[4] = 'untitled-4.jpg' theImages[5] = 'untitled-5.jpg' theImages[6] = 'untitled-6.jpg' theImages[7] = 'untitled-7.jpg' theImages[8] = 'untitled-8.jpg' theImages[9] = 'untitled-9.jpg' theImages[10] = 'untitled-10.jpg' theImages[11] = 'untitled-11.jpg' theImages[12] = 'untitled-12.jpg' theImages[13] = 'untitled-13.jpg' theImages[14] = 'untitled-14.jpg' theImages[15] = 'untitled-15.jpg' theImages[16] = 'untitled-16.jpg' theImages[17] = 'untitled-17.jpg' theImages[18] = 'untitled-18.jpg' theImages[19] = 'untitled-19.jpg' theImages[20] = 'untitled-20.jpg' theImages[21] = 'untitled-21.jpg' theImages[22] = 'untitled-22.jpg' theImages[23] = 'untitled-23.jpg' theImages[24] = 'untitled-24.jpg' theImages[25] = 'untitled-25.jpg' theImages[26] = 'untitled-26.jpg' theImages[27] = 'untitled-27.jpg' theImages[28] = 'untitled-28.jpg' theImages[29] = 'untitled-29.jpg' theImages[30] = 'untitled-30.jpg' theImages[31] = 'untitled-31.jpg' theImages[32] = 'untitled-32.jpg' theImages[33] = 'untitled-33.jpg' theImages[34] = 'untitled-34.jpg' theImages[35] = 'untitled-35.jpg' theImages[36] = 'untitled-36.jpg' theImages[37] = 'untitled-37.jpg' theImages[38] = 'untitled-38.jpg' theImages[39] = 'untitled-39.jpg' theImages[40] = 'untitled-40.jpg' theImages[41] = 'untitled-41.jpg' theImages[42] = 'untitled-42.jpg' theImages[43] = 'untitled-43.jpg' theImages[44] = 'untitled-44.jpg' theImages[45] = 'untitled-45.jpg' theImages[46] = 'untitled-46.jpg' theImages[47] = 'untitled-47.jpg' theImages[48] = 'untitled-48.jpg' theImages[49] = 'untitled-49.jpg' theImages[50] = 'untitled-50.jpg' theImages[51] = 'untitled-51.jpg' theImages[52] = 'untitled-52.jpg' theImages[53] = 'untitled-53.jpg' theImages[54] = 'untitled-54.jpg' theImages[55] = 'untitled-55.jpg' theImages[56] = 'untitled-56.jpg' theImages[57] = 'untitled-57.jpg' theImages[58] = 'untitled-58.jpg' theImages[59] = 'untitled-59.jpg' theImages[60] = 'untitled-60.jpg' theImages[61] = 'untitled-61.jpg' theImages[62] = 'untitled-62.jpg' theImages[63] = 'untitled-63.jpg' theImages[64] = 'untitled-64.jpg' theImages[65] = 'untitled-65.jpg' theImages[66] = 'untitled-66.jpg' theImages[67] = 'untitled-67.jpg' theImages[68] = 'untitled-68.jpg' theImages[69] = 'untitled-69.jpg' theImages[70] = 'untitled-70.jpg' theImages[71] = 'untitled-71.jpg' theImages[72] = 'untitled-72.jpg' theImages[73] = 'untitled-73.jpg' theImages[74] = 'untitled-74.jpg' theImages[75] = 'untitled-75.jpg' theImages[76] = 'untitled-76.jpg' theImages[77] = 'untitled-77.jpg' theImages[78] = 'untitled-78.jpg' theImages[79] = 'untitled-79.jpg' theImages[80] = 'untitled-80.jpg' theImages[81] = 'untitled-81.jpg' theImages[82] = 'untitled-82.jpg' theImages[83] = 'untitled-83.jpg' theImages[84] = 'untitled-84.jpg' theImages[85] = 'untitled-85.jpg' theImages[86] = 'untitled-86.jpg' theImages[87] = 'untitled-87.jpg' theImages[88] = 'untitled-88.jpg' theImages[89] = 'untitled-89.jpg' theImages[90] = 'untitled-90.jpg' theImages[91] = 'untitled-91.jpg' theImages[92] = 'untitled-92.jpg' theImages[93] = 'untitled-93.jpg' theImages[94] = 'untitled-94.jpg' theImages[95] = 'untitled-95.jpg' theImages[96] = 'untitled-96.jpg' theImages[97] = 'untitled-97.jpg' theImages[98] = 'untitled-98.jpg' theImages[99] = 'untitled-99.jpg' theImages[100] = 'untitled-100.jpg' theImages[101] = 'untitled-101.jpg' theImages[102] = 'untitled-102.jpg' theImages[103] = 'untitled-103.jpg' theImages[104] = 'untitled-104.jpg' theImages[105] = 'untitled-105.jpg' theImages[106] = 'untitled-106.jpg' theImages[107] = 'untitled-107.jpg' theImages[108] = 'untitled-108.jpg' theImages[109] = 'untitled-109.jpg' theImages[110] = 'untitled-110.jpg' theImages[111] = 'untitled-111.jpg' theImages[112] = 'untitled-112.jpg' theImages[113] = 'untitled-113.jpg' theImages[114] = 'untitled-114.jpg' theImages[115] = 'untitled-115.jpg' theImages[116] = 'untitled-116.jpg' theImages[117] = 'untitled-117.jpg' theImages[118] = 'untitled-118.jpg' theImages[119] = 'untitled-119.jpg' theImages[120] = 'untitled-120.jpg' theImages[121] = 'untitled-121.jpg' theImages[122] = 'untitled-122.jpg' theImages[123] = 'untitled-123.jpg' theImages[124] = 'untitled-124.jpg' theImages[125] = 'untitled-125.jpg' theImages[126] = 'untitled-126.jpg' theImages[127] = 'untitled-127.jpg' theImages[128] = 'untitled-128.jpg' theImages[129] = 'untitled-129.jpg' theImages[130] = 'untitled-130.jpg' theImages[131] = 'untitled-131.jpg' theImages[132] = 'untitled-132.jpg' theImages[133] = 'untitled-133.jpg' theImages[134] = 'untitled-134.jpg' theImages[135] = 'untitled-135.jpg' theImages[136] = 'untitled-136.jpg' theImages[137] = 'untitled-137.jpg' theImages[138] = 'untitled-138.jpg' theImages[139] = 'untitled-139.jpg' theImages[140] = 'untitled-140.jpg' theImages[141] = 'untitled-141.jpg' theImages[142] = 'untitled-142.jpg' theImages[143] = 'untitled-143.jpg' theImages[144] = 'untitled-144.jpg' theImages[145] = 'untitled-145.jpg' theImages[146] = 'untitled-146.jpg' theImages[147] = 'untitled-147.jpg' theImages[148] = 'untitled-148.jpg' theImages[149] = 'untitled-149.jpg' theImages[150] = 'untitled-150.jpg' var j = 0 var p = theImages.length; var preBuffer = new Array() for (i = 0; i < p; i++){ preBuffer[i] = new Image() preBuffer[i].src = theImages[i] } var whichImage = Math.round(Math.random()*(p-1)); function showImage(){ document.write('<img src="'+theImages[whichImage]+'">'); } var j = 0 var p = thePictures.length; var preBuffer = new Array() for (i = 0; i < p; i++){ preBuffer[i] = new Image() preBuffer[i].src = thePictures[i] } var whichPicture = Math.round(Math.random()*(p-1)); function showPicture(){ document.write('<img src="'+thePictures[whichPicture]+'"align = right >'); } // End --> </script> </head> <body> <script language="JavaScript"> showImage(); </script> <script language="JavaScript"> showPicture(); </script> <h4 align = center> Click Left or Right arrow key to select which one is better. </h4> </body> </html> Ok, problem has been solved! ^^
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? Hello, I have an html script and a .php script. The .php requests a random word from a table of words in a mysql database. I wrote a html form to display the requested word in a text box. Here is my html file: Code: <html> <body> <script type="text/javascript"> function myfunction() { var xmlhttp; if(window.XMLHttpRequest) { xmlhttp= newHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { document.myLingo.word.value=xmlhttp.responseText; } } xmlhttp.open("GET", "get_Word.php",true); xmlhttp.send(null); } </script> <form name="myLingo"> <input type="button" name="button" value="New Word" onClick="myFunction();" /> <input type="text" name="word" /> </form> </body> </html> and here is my .php script: Code: <?php $con=mysql_connect('localhost', 'xxxx', 'xxxx'); if (!$con) { die('Could not connect: '.mysql_error()); } mysql_select_db("my_lingo", $con); $sql=mysql_query("SELECT `word` FROM `words` ORDER BY RAND()") or trigger_error('Error: ' .mysql_error()); $word=mysql_fetch_array($sql); echo $word[0]; mysql_close($con); ?> When I run this in Internet Explorer; I get a error that is asking for an object on line 32 which is the line that has my button in the javascript. When i run it in firefox, I don't receive an error, but the page still does nothing. Any suggestions? The main function of the page is that, when I click the button, it's supposed to return me a random word from the .php script Thanks, jcjst21 Basically what I need to do is cause a bit of HTML to only display on a specific page. I have figured out how to do most of the work i.e. figuring out what page that the code is being displayed on, etc. However, for some reason the DOM element that I am using will not update based on the Javascript. I have searched the Internet for a solution and unfortunately I have found none. Here is the version of the code that I am currently working on: Code: <html> <head> <script type="text/javascript"> window.onload = function DisplayButton() { var DesiredPage = 'Page to Display'; //Page that I want the code to display on var sPath = window.location.pathname; var sPage = sPath.substring(sPath.lastIndexOf('/') + 1); //This determines and places in a variable what page that the code will be on if (sPage == DesiredPage) { document.getElementById('HiddenCode').style.display = "block"; } } </script> <p Id="HiddenCode" style="display:none">Code only to be displayed on indicated page</p> </head> </html> I am somewhat new to Javascript so I feel like I might be missing something obvious here. Thank You to anyone who can help. Zbot Hello I am working on a site for work and on the page http://www.australianvisitor.co.uk/holidayfinder.htm I have a box with several options for the customer to tick to filter a selection of holidays according to destination. With thanks to thecssguy I found some code to do so. The only problem I have is that all the options are ticked by default, resulting in all holidays being displayed. It would be easier if they were all unticked by default allowing the customer to start from scratch so to speak. If i remove the line 'checked=checked' from the input box then: in firefox - the options are unticked but all results are still displayed in ie - the option box itself disappears. Does anyone have any suggestions? Thanks for taking the time to read this. |