JavaScript - Adding Html Element To A Textbox
Trying to add the text "• " to a text area, but it will just print the symbol. Is there a way you can print the string itself?
Code: function add(myValue) { //IE support if (document.selection) { desc.focus(); sel = document.selection.createRange(); sel.text = myValue; } Code: ...onclick="add('• ')" Similar TutorialsBelow is the script and form fields I am working with. What I want to do is sum the two textbox fields and have the result show in the total textbox. The code works fine and the total textbox is updated with the value of form1.basic. The problem occurs when I add the "+ parseInt(document.form2.supporter.value)" code in the script section. What am I doing wrong? Thank you for your time and help. Code: <script type="text/javascript"><!-- function updatesum() { document.frmtotal.total.value = parseInt(document.form1.basic.value) + parseInt(document.form2.supporter.value)} //--></script> <tr> <td width="111"><form id="form1" name="form1" method="post" action=""> <label for="basic">$</label> <input name="basic" type="text" id="basic" size="7" maxlength="7" onchange="updatesum(this.form)" /> </form></td> </tr> <tr> <td><form id="form2" name="supporter" method="post" action=""> <label for="supporter">$</label> <input name="supporter" type="text" id="supporter" size="7" maxlength="7" onchange="updatesum(this.form)" /> </form> Hello guys (and girls) I am messing with this whole day, 'cos I wanted to try and figure this out by myself instead of going on forums. I failed, as you may see. So, to cut it short: I needed to calculate my prices on-the-fly and display it in textbox with javascript. Well I did succeed with values of radio button an checbox, but as i know very little javascript, I don't know how to expand the code i got from he http://javascript.internet.com/forms...e-refresh.html So what I would LOVE to know, is how can I make this happen: I have a textbox: Code: <input type="text" name="podstranice" size="19" class="podstr" onkeyup="this.form.total.value=calculateTotal(this);"> and when a user inputs a number in it, javascript multiplies it with some other number, say 10 (its a price*quantity thing) and adds it to the total price along with data from checkboxes and radio buttons. And so, this is my javascript. It is basically identical to one on the link, but you can view it better this way I think. Code: // Calculate the total for items in the form which are selected. function calculateTotal(inputItem) { with (inputItem.form) { // Process each of the different input types in the form. if (inputItem.type == "radio") { // Process radio buttons. // Subtract the previously selected radio button value from the total. calculatedTotal.value = eval(calculatedTotal.value) - eval(previouslySelectedRadioButton.value); // Save the current radio selection value. previouslySelectedRadioButton.value = eval(inputItem.value); // Add the current radio button selection value to the total. calculatedTotal.value = eval(calculatedTotal.value) + eval(inputItem.value); } else { // Process check boxes. if (inputItem.checked == false) { // Item was uncheck. Subtract item value from total. calculatedTotal.value = eval(calculatedTotal.value) - eval(inputItem.value); } else { // Item was checked. Add the item value to the total. calculatedTotal.value = eval(calculatedTotal.value) + eval(inputItem.value); } } elseif // Total value should never be less than 0. if (calculatedTotal.value < 0) { InitForm(); } // Return total value. return(formatCurrency(calculatedTotal.value)); } } // Format a value as currency. function formatCurrency(num) { num = num.toString().replace(/\$|\,/g,''); if(isNaN(num)) num = "0"; sign = (num == (num = Math.abs(num))); num = Math.floor(num*100+0.50000000001); cents = num%100; num = Math.floor(num/100).toString(); if(cents<10) cents = "0" + cents; for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) num = num.substring(0,num.length-(4*i+3)) + ',' + num.substring(num.length-(4*i+3)); return (((sign)?'':'-') + num + '.' + cents + ' kn'); } // This function initialzes all the form elements to default values. function InitForm() { // Reset values on form. document.selectionForm.total.value='$0'; document.selectionForm.calculatedTotal.value=0; document.selectionForm.previouslySelectedRadioButton.value=0; // Set all checkboxes and radio buttons on form to unchecked. for (i=0; i < document.selectionForm.elements.length; i++) { if (document.selectionForm.elements[i].type == 'checkbox' | document.selectionForm.elements[i].type == 'radio') { document.selectionForm.elements[i].checked = false; } } } I don't want to overspam my post with more code, so I hope this is all you need, at least for now. THANK YOU very much in advance. hi All, I want to add UL item to Li in java script dynamically .so that i can build submenu dynamically.can any one help me. I have the following HTML code: Quote: <form id="registration" action="/cgi-bin/registration.cgi" method="POST" onsubmit="return control()"> <fieldset> <legend>Fill up this module</legend> Private <input id="private" type="radio" name="type" value="private" onclick="return addPrivate()"/><br/> Community/Organization <input id="organization" type="radio" name="type" onclick="alert('Organization')"/><br/> <br/> and the following javascript code: Quote: function addPrivate() { var root = document.getElementById('registration'); var label1 = document.getElementById('label'); label1.appendChild(document.createTextNode('First Name: ')); var label2 = document.getElementById('label'); label2.appendChild(document.createTextNode('Last Name: ')); var label3 = document.getElementById('label'); label3.appendChild(document.createTextNode('Address*: ')); var label4 = document.getElementById('label'); label4.appendChild(document.createTextNode('Profession: ')); var div = document.createElement('div'); div.appendChild(label1); div.appendChild(label2); div.appendChild(label3); div.appendChild(label4); root.appendChild(div); } but div tag is not added. Where is the problem? Hello, all. I have a script that toggles an element's style between display block and display none based on an onclick event. It's being implemented in a content management system (WordPress) so it has some dynamic post ID's assigned to it. I have tried editing it to toggle the variable "type" so that I can have the class of the div change with the rest of the variables being swapped during the toggle, but no matter what I've changed I can't seem to get it to update the variable when someone clicks on the link with the onclick event. Everything else works perfectly, content is shown and hidden when you click the link, I just can't get the "type" variable to switch. I think it's something to do with the JavaScript function itself (it looks to me like it's only looking at 4 variables and this new one would be a new variable that's being toggled). Below is the code. How can I get the type variable to update like the others (hidden_css, tmp_text, more_text, less_text)? Code: /*-----------------------------------------------------------------------------------*/ // Show Hide Posts /*-----------------------------------------------------------------------------------*/ ### Function: Enqueue JavaScripts add_action('wp_enqueue_scripts', 'showhide_scripts'); function showhide_scripts() { wp_enqueue_script('jquery'); } ### Function: Short Code For Inserting Show/Hide Into Post add_shortcode('showhide', 'showhide_shortcode'); function showhide_shortcode($atts, $content = null) { // Variables $post_id = get_the_id(); // Extract ShortCode Attributes extract(shortcode_atts(array( 'type' => 'show', 'more_text' => __('View Full Post'), 'less_text' => __('Close Post'), 'hidden' => 'yes' ), $atts)); // Determine Whether To Show Or Hide Content $hidden_css = 'display: none;'; if($hidden == 'no') { $hidden_css = 'display: block;'; $type = 'hide'; $tmp_text = $more_text; $more_text = $less_text; $less_text = $tmp_text; } // Format HTML Output $output = '<div id="'.$type.'-content-'.$post_id.'" class="'.$type.'-content" style="'.$hidden_css.'">'.$content.'</div>'; $output .= '<div class="'.$type.'-link"><a href="#" onclick="showhide_toggle(\''.$type.'\', '.$post_id.', \''.esc_js($more_text).'\', \''.esc_js($less_text).'\'); return false;"><span id="'.$type.'-toggle-'.$post_id.'">'.$more_text.'</span></a></div>'; return $output; } ### Function: Add JavaScript To Footer add_action('wp_footer', 'showhide_footer'); function showhide_footer() { echo '<script type="text/javascript">'."\n"; echo '/* <![CDATA[ */'."\n"; echo 'function showhide_toggle(a,b,c,d){jQuery("#"+a+"-content-"+b).toggle();jQuery("#"+a+"-toggle-"+b).text(jQuery("#"+a+"-toggle-"+b).text()==c?d:c)};'."\n"; echo '/* ]]> */'."\n"; echo '</script>'."\n"; } hi this is santosh first off all thanks in advance to all who r reading my question im in prblm in my project in 1 file i have to first display textbox in html statically which will hav + & - button preceding it , & on click of + button one more textbox should appear dynamically & first textbox + button should disapper & it should hav only - button & the textbox which was dynamically generated now on click of first textbox + button should hav + & - button & it should go on. & on click of - button textbox which is in front of it should get deleted. here i tried alot but my code is showing + & - button to every textbox that is dynamically generated which is not the requirement plz help me im in great need. earlier also i hav submitted my queries & got a fully satisfied result bcoz of that now im having great hopes from u & this site plz reply as early as possible waiting for ur reply again thanks in advance hi, i am using <input type = "file" id = "upload"> in my html page. i want to disable the textbox of this control so that user cannot type any file location here. user can upload file only through browse button. is there a way to disable this textbox thru javascript? thnx Hi.. I have form and i want to input data using barcode and it will display on textbox and after input on the first textbox the focus will go to next textbox untill it will go on the last textbox and on the last textbox it will automatically save the data's on the database. How is it possible? here is my sample code: Code: <?php error_reporting(0); date_default_timezone_set("Asia/Singapore"); //set the time zone $con = mysql_connect('localhost', 'root',''); if (!$con) { echo 'failed'; die(); } mysql_select_db("mes", $con); ?> <html> <head> <script type="text/javascript"> function ini() { // Retrieve the code var code =document.getElementById ("code_read_box1").value; var code =document.getElementById ("code_read_box2").value; var code =document.getElementById ("code_read_box3").value; var code =document.getElementById ("code_read_box4").value; var code =document.getElementById ("code_read_box5").value; var code =document.getElementById ("code_read_box6").value; // Return false to prevent the form to submit return false; } </script> </head> <body onLoad="document.barcode.code_read_box1.focus()"> <form name=barcode onsubmit = "return ini()"> <input type="text" id="code_read_box1" value="" /><br/> <input type="text" id="code_read_box2" value="" /><br/> <input type="text" id="code_read_box3" value="" /><br/> <input type="text" id="code_read_box4" value="" /><br/> <input type="text" id="code_read_box5" value="" /><br/> <input type="text" id="code_read_box6" value="" /><br/> </form> </body> </html> Hello. I've been teaching myself HTML and CSS for a while, and now I've moved into the world of Javascript (but I'm still very much a beginner). For practice, I've been building a sample sign up form for a mock website, and I'm having problems with the birthdate section. The idea I had was to have MM, DD, and YYYY be the default values of my 3 textboxes (as an example for users), then set the value to nothing when the box gained focus. That all works fine, but I ran into problems when I tried to write an if statement to set the value back to MM, DD, or YYYY if the value was still nothing when the user clicked away. As it is now it just replaces the text inputted into the textbox (which of course is not good). Any ideas for what the problem might be? Code: <form name="signup" action="javascript:void(0);" method="post"> <table> <tr> <td>Date Of Birth:</td> <td> <input name="DOBmonth" type="text" value="MM" size="2" style="color: #555555;" onFocus="clearDOBmonth()" onBlur="restoreDOBmonth()" /> <input name="DOBday" type="text" value="DD" size="2" style="color: #555555;" onFocus="clearDOBday()" /> <input name="DOByear" type="text" value="YYYY" size="4" style="color: #555555;" onFocus="clearDOByear()" /></td> </tr> <tr> <td></td> <td><button name="Submit" type="submit" style="font-size: 1em;">Sign Up</button></td> </tr> </table> </form> <script type="text/javascript" language="javascript"> <!-- document.signup.DOBmonth.value="MM"; document.signup.DOBday.value="DD"; document.signup.DOByear.value="YYYY"; function clearDOBmonth() { document.signup.DOBmonth.value="";} function clearDOBday() { document.signup.DOBday.value="";} function clearDOByear() { document.signup.DOByear.value="";} function restoreDOBmonth() { if ('document.signup.DOBmonth.value = ""') { document.signup.DOBmonth.value = "MM"; // alert(document.signup.DOBmonth.value); } } //--> </script> Another side question, if I set a variable equal to the value of a textbox, then change the value of the variable, does that also change the value of the textbox? or is the variable no longer associated with the textbox. Example: Code: var a = document.form.textbox.value; a = blue; does document.form.textbox.value = blue? or is var a now completely independent of the textbox value? Thanks! Dear forum, I'm making a site for my g/f – She's writing angel messages for each day of the year, 1 message on 1 page and these (eventually 366 pages) are accessed from this one page: http://www.helderziendelezingen.be/w...per-datum.html This menu page uses JS to slide to particular months. The place I'm stuck is how could it be possible to go from a particular days message, back to the month of that message in the per-datum page (having the page slid to that month)... for clarities sake... “Terug” means “back”, so for example to click on october 22nd message, read the message, and terug back to Octobers seeds rather than back to the per datum pages month selection calender. My best effort so far is to put this in the a tag: onclick="document.getElementById('waarzegstermove').style.cssText='left: -1000px;';" -1000px would be Januarys terugs, -2000px Februarys terugs etc to have it already slid to that month, this code works when on the same page, but when its on the message page before loading up the per datum page it seems to lose this setting. I would really appreciate help on this – to be honest I've never used cookies, I dont know what they're for, am I on the right track, is there something else involved like location: hash? or is this what cookies are for? many thanks, Will I am not a master of javascript. I am only beginning. I know how to edit most codes I come by to make them work for what I need them for, but I haven't really been able to get this concept to work. I know there is a way to count the characters of a text box. I have used them a thousand times. (Think twitter) I am making a forum, and I am not self-hosting. So I don't have access to change all of the HTML on the forum software. So, here is what I want to do, and I really just need to know if its possible. There is a reply box on this forum. A pre-existing element. It cannot be changed by going into the html, because I don't have access to it. I want a box to appear underneath it to count the number of characters that are typed into that box, and cut off if they go over. I know of codes that allow you to count characters in a box you create, because you can add the "onkeyup=" to the html... I just don't have access to that part. Do you see where I'm getting at? So to further illustrate, something like this: If it can be done, can someone show me how? I have the idea of how it might work, but I don't know enough to make my own code, only enough to figure out what existing code is talking about. I am sorry if this doesn't make sense. I can try to explain further if need be. Hello I am pretty new to AJAX & I am making a simple program to input new text refresh inside the HTML element that has the id='result'. My Problem: - The AJAX script fails when I try to change the text inside 'result' using my code, sometimes a whole new page opens with the text I wanted to put inside the result HTML element. Sometimes I just get a notification that an error occured. - I believe it is because of my function state_changed & using the parameter element_id with the function getElementById(element_id).innerHTML = ...; - It should be easy to see where my problem occurs when you look at my code Any advice on why the script fails & how to fix it would be extremely helpful. Code: var xmlHttp; function ajax_compatible() { // Post: Returns an object if browser is AJAX compatible else false. if (window.XMLHttpRequest) { // users web browser can support AJAX return ( new XMLHttpRequest() ); } else if (window.ActiveXObject) { // users web browser is IE6 and IE5 return ( new ActiveXObject("Microsoft.XMLHTTP") ); } else { alert("Unfortunately your browser does not support AJAX."); return null; } } function get_cookie(cookie_name) { if (document.cookie.length > 0) { c_start = document.cookie.indexOf(cookie_name + "="); if (c_start != -1) { c_start = c_start + cookie_name.length+1; c_end = document.cookie.indexOf(";",c_start) if (c_end == -1) { c_end = document.cookie.length; } return unescape(document.cookie.substring(c_start,c_end)) } } return "" } function add_comment() { // Post: Add user comment & rating to database and update new table row. // DO WE NEED TO SEND COOKIE ASWELL OR IS IT ALREADY DONE??? xmlHttp = ajax_compatible(); if (xmlHttp == null) { return; } var url = 'http://localhost:8000/cgi-bin/main.py'; alert("add_comment() running"); // Extract CGI variables to pass onto python script var id = document.getElementById('videoID').value; var video_id = 'videoID=' + id; var rating = 'rating=' + document.getElementsByName('rating').value; var comment = 'comment=' + document.getElementById('comment').value; var add_rating = 'addRating=' + document.getElementById('addRating').value; //var cookie = document.cookie; cgi_var = video_id + '&' + rating + '&' + comment + '&' + add_rating; // + '&' + cookie; // open python script xmlHttp.open('POST',url,true); xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); // Error is in below line xmlHttp.onreadystatechange = state_changed(id); // if I use the following line then it works // xmlHttp.onreadystatechange = test; xmlHttp.send(cgi_var); } function state_changed(element_id) { // Post: Use one function that will be used for each page update. // This function sends the text returned by the python server script // onto the browser(HTML element with the id 'element_id') to be displayed. if (xmlHttp.readyState == 4) { document.getElementById(element_id).innerHTML = xmlHttp.responseText; } } function test() { // Post: used to test where the problem occurs // This function works if (xmlHttp.readyState == 4) { document.getElementById('result').innerHTML = xmlHttp.responseText; } } The bit of code in bold in the code below is giving me this error in IE: Error: Code: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; Tablet PC 2.0; InfoPath.2; OfficeLiveConnector.1.4; .NET CLR 3.0.30729; OfficeLivePatch.1.3; MSN OptimizedIE8;ENGB) Timestamp: Tue, 16 Mar 2010 15:07:11 UTC Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917) Line: 0 Char: 0 Code: 0 URI: http://www.mateinastate.co.uk/users/mateinastate Code: Code: if(document.getElementById('msn1').innerHTML=="") { document.getElementById('msn1').style.display='none'; } if(document.getElementById('yahoo1').innerHTML=="") { document.getElementById('yahoo1').style.display='none'; } if(document.getElementById('skype1').innerHTML=="") { document.getElementById('skype1').style.display='none'; } if(document.getElementById('facebook1').innerHTML.toLowerCase().substr(0,18)=='<a href="http://">') { document.getElementById('facebook1').style.display='none'; } else if(document.getElementById('facebook1').innerHTML.toLowerCase().substr(0,11)=='<a href="">') { document.getElementById('facebook1').style.display='none'; } else { document.getElementById('fbook-add').innerHTML='Facebook Profile'; } What it's saying isn't actually true (I don't think)... this is how the section is laid out: Code: <div id="submenu1" class="anylinkcss"> <ul> <li class="contact-pm"><a href="/index.php?do=pm&act=new&to=$RateViewProfileUserName$&returnurl=$ReturnURL$">PM me</a></li> <li class="contact-email"><a href="/index.php?do=email&id=$RateViewProfileUserId$">E-mail me</a></li> <li class="contact-msn" id="msn1">$RateViewProfileUser-profile_msn$</li> <li class="contact-yahoo" id="yahoo1">$RateViewProfileUser-profile_yahoo$</li> <li class="contact-skype" id="skype1">$RateViewProfileUser-profile_skype$</li> <li class="contact-facebook" id="facebook1"><a href="$RateViewProfileUser-profile_facebook$"><span id="fbook-add"></span></a></li> </ul> </div> <script type="text/javascript" src="/html_1/js/contact-information.js"></script> Does anyone know why this might error in just IE? Years ago I created HTML that employs checkboxes and textboxes. I am now writing JS with the intention of adding flexibility and limiting redundancy. I am not sure I truly understand how to correctly interact the two though. For example, one of my scripts have arrays that contain the names of the checkboxes and textboxes, with a 'for' loop to document.write() them to references within the HTML code. This does not seem to be working for me though. Here is what I have thus far (in short): Code: <script language="javascript"> var teamNames = new Array(3); teamNames[0]="South Africa"; teamNames[1]="Mexico"; teamNames[2]="Uruguay"; for (i=0; i<=31; i++) { document.write("<p>" + teamNames[i] + "<\/p>"); } </script> </head> <body> <tr><td>Jun 11</td><td><input type="checkbox" name="teamNames[0]" value="teamAbbr[0]"></td> </body> I've left out a lot of the code (to include the teamAbbr array, but you get the points. I've tried moving the JS within the HTML body and playing with the reference syntax, but nothing so far. Any help would be great! Hey guys, I have a script which adds more text fields to a div in a form, but when it adds a new field the text in the others is cleared. :S http://martynleeball.goodluckwith.us/ PHP 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=utf-8" /> <title>Draw Somthing - Word Guess</title> <script type="text/javascript"> function add_field(obj, count) { //Count how many fields there is so the correct number can be added to the ID var form_name = document.getElementById(obj); var inputs = form_name.getElementsByTagName('input'); var g = 1; //alert("Container: " + obj + ". Inputs: " + inputs.length); for ( var i = 0; i < inputs.length; i++) { var node = inputs[i]; if (node.getAttribute('type') == 'text') { g++; } } //Field to add to the form if (!count) { if (g < 9) { var text_field_html = "<input type=\"text\" id=\"input" + g + "\" name=\"input" + g + "\" /><input type=\"button\" value=\"X\" onClick=\"remove_field(\'text_field_container\', this)\" id=\"close" + g + "\"/>"; form_name.innerHTML += text_field_html + "<br id=\"br_" + g + "\" />"; } } } function remove_field(parent_id, r_obj) { var parent = document.getElementById(parent_id); var child = document.getElementById(r_obj.id); var num = r_obj.id.charAt(r_obj.id.length-1); var child2 = document.getElementById('input' + num); var child3 = document.getElementById("br_" + num); parent.removeChild(child); parent.removeChild(child2); parent.removeChild(child3); } </script> </head> <body> <br /> <form id="add_words" action="test.php" method="post"> <div id="text_field_container"> <input type="text" id="input1" name="input1" /><input type="button" value="X" id="close1" onClick="remove_field('text_field_container', this)"/> <br id="br_1" /> </div> <input type="button" value="Add more..." onclick="add_field('text_field_container')" /> <input type="submit" value="Submit" onclick="" /> </form> </body> </html> Hi everyone, I have successfully added Flash to my page but I want the flash animation to be inside the <div id="main">. For some reason when I put the <div id="flashcontent"></div> inside the main div it doesn't show up on the page. Please help. My code is below: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>MikeJamesDesigns</title> <link rel="stylesheet" type="text/css" href="cssEdit.css" /> <script type="text/javascript" src="js/flashobject.js"></script> <script type="text/javascript"> var fo = new FlashObject("bannerISRAEL.swf", "animationName", "450", "60", "8", "#FFFFFF"); fo.addParam("allowScriptAccess", "sameDomain"); fo.addParam("quality", "high"); fo.addParam("scale", "noscale"); fo.addParam("loop", "true"); fo.write("flashcontent"); </script> </head> <body> <!--<div class="tikiImage"> <img src="/Users/MikeJamesRossi/Desktop/cssEdit/images/tiki.png" alt="tikiTorch" height="1040px" width="1100px"/> </div>--> <div id="wrapper"> <div id="sitebranding"> </div><!--end of sitebranding div--> <div id="navigation"> <a href="home">Home</a> | <a href="about">About</a> | <a href="news">News</a> | <a href="images">Images</a> | <a href="home">Faq</a> | <a href="contact">Contact</a> </div><!--end of navigation div--> <div id="main"> <div id="flashcontent"></div> </div><!--end of main div--> </div><!--end of wrapper div--> </body> </html> My css file looks like this: #flashcontent { position: relative; top: 500px; left: 365px; width: 60px; heightx; background-color:red; z-index: ; } Any help would be greatly aprreciated!! Thanks Mike! Hi, I'm relativly new to JS and brand new to the forum so you might need to dumb down your replys for my slightly lacking knowledge. That being said I do have a very solid grasp of html, css and am getting there with JS and its various frameworks. I'm integrating wordpress into an existing site for a friend and currently have the main blog page appear in a DIV. This is the best way to integrate in this case due to many reasons mostly of way the site is constructed. Code: <div class="scroll-pane" id="scrollbox"> WORDPRESS BLOG </div> My issue is that links within that DIV, in the blog, when clicked redirect the page. The simple answer to this would be to have them just open in a new page, which I can easily do with the below code. Code: function Init() { // Grab the appropriate div theDiv = document.getElementById('scrollbox'); // Grab all of the links inside the div links = theDiv.getElementsByTagName('a'); // Loop through those links and attach the target attribute for (var i=0, len=links.length; i < len; i++) { // the _blank will make the link open in new window links[i].setAttribute('target', '_blank'); } } window.onload = Init; But what I'd rather it do is have any link clicked inside the DIV to reload in that same DIV, similar to an iframe, but obviously without using an iframe, due to it's compatibility issues. Is this possible by editing the above code? If not what do I need? Thanks in advance for any help! Hey guys. This is vague because I dont know what exactly to tell you but please reply with me so I can fix this. I want to add something to my forum. Specifically, I want to add a HTML and Picture button for when you go to reply. Like posting an article here, there are also these options (font, alignment, insert image) I do not know how to achieve this but shouldnt be too hard. Here are the two sources you will need to look through to help me fix the forum. http://neoweather.com/FWFORUM.JS http://static.websimages.com/JS/fw.js THANKS |