JavaScript - Assistance Stretching Image In Div With Url() Source...
Greetings,
First off - You can see my problem at psychopathgames.com I have an image stretched to fit as the page background in a DIV and the page content inside a seperate DIV. When you mouseover the links, the background changes to represent each link (as does the color of the link... but that is working fine). Trouble is, the images that are being pulled aren't fullsized as the main background is... it is being cut off by some code I can't figure out and isn't resizing. Please visit the site to see what talking about. Here is the code... Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Psychopath Games</title> <style type="text/css"> html, body {height:100%; margin:0; padding:0;} #page-background {position:fixed; top:0; left:0; width:100%; height:100%;} #content {position: relative; z-index:1; padding:10px;} </style> <!--[if IE 6]> <style type="text/css"> html {overflow-y:hidden;} body {overflow-y:auto;} #page-background {position:absolute; z-index:-1;} #content {position:static;padding:10px;} </style> <![endif]--> <style type="text/css"> A:link {text-decoration: none} A:visited {text-decoration: none} A:active {text-decoration: none} A:hover {text-decoration: none} </style> <script language="JavaScript"> <!-- img0_on = new Image(100,11); img0_on.src="images/titlesred.png"; img0_off = new Image(100,11); img0_off.src="images/titles.png"; img1_on = new Image(130,11); img1_on.src="images/contactred.png"; img1_off = new Image(130,11); img1_off.src="images/contact.png"; img2_on = new Image(170,11); img2_on.src="images/talentred.png"; img2_off = new Image(170,11); img2_off.src="images/talent.png"; function over_image(parm_name) { document[parm_name].src = eval(parm_name + "_on.src"); } function off_image(parm_name) { document[parm_name].src = eval(parm_name + "_off.src"); } --> </script> <script type="text/javascript"> function showIt1(imgsrc) { newImage = "url(images/backgroundone.jpg)"; document.getElementById('content').style.backgroundImage = newImage; } function showIt2(imgsrc) { newImage = "url(images/backgroundtwo.jpg)"; document.getElementById('content').style.backgroundImage = newImage; } function showIt3(imgsrc) { newImage = "url(images/backgroundthree.jpg)"; document.getElementById('content').style.backgroundImage = newImage; } function hideIt() { newImage = "url(images/background.jpg)"; document.getElementById('content').style.backgroundImage = newImage; } </script> </head> <body> <div id="page-background"> <img src="images/background.jpg" width="100%" height="100%"> </div> <div id="content"> <center> <img src="images/title.png"> <br><br> <br> <table width="100%"> <tr> <td width="40%" align="right" valign="bottom"> <a href="titles.html" onmouseover="over_image('img0'); showIt1(this.src);" onmouseout="off_image('img0'); hideIt();"> <img src="images/titles.png" border="0" name="img0"> </a> <br> <br> <a href="contact.html" onmouseover="over_image('img1'); showIt2(this.src);" onmouseout="off_image('img1'); hideIt();"> <img src="images/contact.png" border="0" name="img1"> </a> <br> <br> <a href="talent.html" onmouseover="over_image('img2'); showIt3(this.src);" onmouseout="off_image('img2'); hideIt();"> <img src="images/talent.png" border="0" name="img2"> </a> <br> <br> </td> <td width="60%"> <center> <img src="images/eye.png"> </td> <tr> </table> </div> </body> </html> Similar TutorialsVery new to Javascript (been a HTML/CSS guy for a while, but never really got into more than tinkering with other other people's Javascript coding), but I came across a situation I can't find canned coding for, and trying to create it from bits and pieces I Googled has led me to a dead-end. In summary, I have a website that I frequently visit (FWIW, Firefox 3.x is my browser of choice) with many image sources referring to URLs that end with "-thumbnail.jpg". However, for better image quality, I am trying to use Greasemonkey to replace all instances of "-thumbnail.jpg" in the source of images on this site with "-bigthumbnail.jpg". The closest I could think of was to somehow use getElementsByTagName and innerHTML.replace, but realized that innerHTML does not do HTML, only content. Below is as far as I tried to get on my own, I appreciate any assistance from the folks here to help a JS novice like myself, thanks! Code: (function() { var as,ae; as = document.getElementsByTagName("img"); for (var i = 0; i < as.length; i++) { ae = as[i]; ae.innerHTML = ae.innerHTML.replace(/-thumbnail/gi, "-bigthumbnail"); } })(); i have image button i need to display image .if the size of the image button is 100*100 and image size is 50*50 .the remaining space of the image button should be empty.the image should not stretch. can any one guide me i am new to programming Thanks in advance!!! I am currently trying to write a javascript function which checks whether the source of an image is one thing, if so do this, if not do something else. Any help is much appreciated. Below is the code I have tried... Code: if(document.getElementById("field").src == "images/tick.png"){ alert("this is the tick image"); } I cannot get this function to work properly. Any help would be appreciated, please understand i am not so good at scripting i am trying to check the source of multiple images in one if statement to run a sound. Code: function victory() { if (document.getElementById("Image0").src == "0.jpg" + document.getElementById("Image1").src == "1.jpg" + document.getElementById("Image2").src == "2.jpg" + document.getElementById("Image3").src == "3.jpg" + document.getElementById("Image4").src == "4.jpg" + document.getElementById("Image5").src == "5.jpg" + document.getElementById("Image6").src == "6.jpg" + document.getElementById("Image7").src == "7.jpg" + document.getElementById("Image8").src == "8.jpg" + document.getElementById("Image9").src == "9.jpg") { document.getElementById("vic").currentTime = 0; document.getElementById("vic").play(); } else{ } } Reply With Quote 01-21-2015, 05:19 PM #2 Dormilich View Profile View Forum Posts Senior Coder Join Date Jan 2010 Location Behind the Wall Posts 3,532 Thanks 13 Thanked 372 Times in 368 Posts + is the addition, concatenation and number casting operator. the logical AND operator is &&. cf. https://developer.mozilla.org/en-US/..._and_Operators This is really annyoing. I'm trying to set up an image's source from a function within the document's head, but to no avail. The code is something like this: ------------------------------------------------------- <head> .....js code..... function updatePieChart() { document.pie_chart.src = "piechart.php?p1&p2"; // php-generated image, with parameters } // A FUNCTION WHICH SUCCESSFULLY RUNS EVERY 2-3 SECONDS function ajax() { ....stuff..... // THE NEXT LINE DOESN'T WORK!!! // updatePieChart(); ...stuff..... } ....js code...... // THE NEXT LINE DOESN'T WORK!!! // updatePieChart(); </head> //THIS LINE WORKS LIKE A CHARM <body onload="updatePieChart();"> ....bla bla bla... <img src="#" name="pie_chart" /> ...bla bla bla.... </body> ------------------------------------------------------- As you can see, the function updatePieChart works wonderfully from the <body> tag of the function, but any attempt to call it from within the <head> tags fails. Also, I've tried to change the function updatePieChart so that it wouldn't call any php code and changed it to a simple document.pie_chart.src = "#"; but that still causes errors on the page when called from inside the <head> tags. On the other hand, if the function updatePieChart merely made an alert() call, then the ajax element works fine, and every so and so seconds I get an alert. Anyone, help? An explanation how come I can't set the image from within the <head> tags? I need to change the source of an image but I can't seem to figure out how. I believe that I have the correct syntax, but it does not seem to be working. Maybe I am typing it in wrong or something. I try to test my javascript by typing the script: <strong>javascript:document.getElementById('img1').src='./images/image1.jpg';</strong> into the address bar. Nothing happens. I also try to test it out by putting this on the page, but once again, nothing happens. Code: <script type="text/javascript"><!-- document.getElementById('im1').src="./scripts/'.$upload_image.'"; //--></script> This is what my HTML code looks like: Code: <img src="./images/temp_wizard_picture.gif" alt="" style="padding:4px; background:#fff; border:1px #bbb solid;" id="img1" /> Can somebody please fill me in on what I am doing wrong. Thank you. recently i noticed that all of my embedded JavaScript code and external style sheets are being shown IN "view source." this happens in all browsers ( IE, FF, Chrome, and Safari [windows]) ... oddly enough it only happens when viewing on my vista or win2k3 machines. is this something added to these OS's or the result of an installed program? has anyone seen this before? JS beginner here; Ok, I'm trying to manipulate the functions of Codaslider for a layout. What I need is the ability to use an image for slide dynamic slide navigation. I've solved the issue for dynamic hashing, however I'm stuck at modifying the HTML. I've tried a few things but I figure this is the easiest way... This is what I've got so far; function navigate () { var url = document.getElementById('back'); url.href = page_back(); return url; } function page_back(inward) { new Object(inward.location.hash); var rehash = inward.location.hash.match(/[^#]/); if (rehash == 1) { rehash = 5; } else if(rehash == 2) { rehash = 1; } else if(rehash == 3) { rehash = 2; } else if(rehash == 4) { rehash = 3; } else if(rehash == 5) { rehash = 4; } else if(rehash == null) { rehash = 5; } else{rehash = "Invalid URL or REFERRER"} inward.location.hash = rehash; return inward.location.href; }; Implemented here; <a href="#5" id="back" class="cross-link"> <input type="image" class="left_arrow" src= "images/leftarrow.png" onclick="navigate()" /></a> What I expect this to do is change the href value to "#1" so that Codaslider will do it's thing while I provide a stationary dynamic image for slide browsing. Anyone have any idea what i'm doing wrong? page_back works fine but navigate seems to be useless. I've been wanting to create a sort of user controlled cms... Something that a user controls no matter if there logged in or not, Something that works on flatfile no PHP no server side scripting. Just browser scripting. I was wondering if this was even possible to do, or if it's been done before. Thanks in advance.
http://jsfiddle.net/Wsekx/ Populate the following array with string data instead of numeric data, and then test it with these states as data: "Georgia", "Colorado". "Iowa", "Florida", "Kentucky", and "Arizona." How exactly do I do this? So confused after reading this So I have the jcarousel with pagination working fine. So Im happy with all of the behavior that is going on right now, it is great. My issue is I would liek to have the pagination numbers still change the class on the slide changes, But my one thing is, I want to make the pagination numbers NOT links. So they keep the same hover states and the color changes on slide change, but only the slide carousel arrows can change the slides, and the pagination is only for notification purposes. not links or able to change slides. Can this be done? my code is here http://www.cesariomendoza.com/jcarousel/
i have a selection menu here. what i would like to do is that when i select "not copy" it will not show and not copy the contents of "todo" textfield. but when i select any of the "copy text" it will show and copy the contents of the "todo" text. help plsssssssssssssssssss <!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>Untitled Document</title> </head> <body> <form id="form" name="form" method="post" action=""> <p>Phone Number: <input type="text" name="Name" /> </p> <p>Location: <select name="selector" > <option>copy text</option> <option>not copy text</option> <option>copy text</option> <option>copy text</option> </select> </p> <p>To Do Today: <input type="text" name="todo" /> </p> <p> <input type="button" value="Copy" /> </p> </form> </body> </html> I am needing to use javascript to show a prompt, and when the user enters a number from 1-12 (1 for each month of the year) it adds it to a new array. Then when the user types "stop" it prints the corresponding months. I'm new to javascript so I am not quite sure how to go about doing it. This is what I have currently, but I don't think it is right. Code: <script type="text/javascript"> var month=['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; var selmonth= new Array(); var month2=prompt('Which Month', ''); if (month2==1){ selmonth[0] = month[1]; var month2=prompt('Which Month', ''); } if (month2==2){ selmonth[1] = month[2]; var month2=prompt('Which Month', ''); } if (month2==3){ selmonth[2] = month[3]; var month2=prompt('Which Month', ''); } if (month2==4){ selmonth[3] = month[4]; var month2=prompt('Which Month', ''); } if (month2==5){ selmonth[4] = month[5]; var month2=prompt('Which Month', ''); } if (month2==6){ selmonth[5] = month[6]; var month2=prompt('Which Month', ''); } if (month2==7){ selmonth[6] = month[7]; var month2=prompt('Which Month', ''); } if (month2==8){ selmonth[7] = month[8]; var month2=prompt('Which Month', ''); } if (month2==9){ selmonth[8] = month[9]; var month2=prompt('Which Month', ''); } if (month2==10){ selmonth[9] = month[10]; var month2=prompt('Which Month', ''); } if (month2==11){ selmonth[10] = month[11]; var month2=prompt('Which Month', ''); } if (month2==12){ selmonth[11] = month[12]; var month2=prompt('Which Month', ''); } if (month2=='stop'){ document.write(selmonth.join(" <br> ")); } else{ alert('Please enter a valid value'); } </script> It'd be great if someone is able to help me. Thanks. Evening all, I am by no means a JS programmer, but I like to exhaust all avenues when attacking an issue. A signature fired off on a piece of javascript that came across the wire, with an odd "var unescape" inside of it. I am hoping to throw this code out there, to see if anyone has any insight on what this might be. I am assuming this is double encoded, but I am not certain. Here is the snippet of code the signature fired off from: var ibdf=unescape("%u0b0b%u0b0"+"b"); var fdofdopf="xcvb9090"; Thanks in advance for anyone willing to assist with this. Cheers, Anon I wish to create an applett, which i am working on, Though I want to know if there is any way to: 1) Take screenshots of entire web page 2) Take screenshots of a certian part of the web page selected by the user with a Rectangle tool 3) Take screenshots of a certian part of the web page selected by the user with a FreeForm tool Im not asking for a full code or anything, But I just wish to know in what way could i go about this? Hi Guys, I would like to add a confirmation to this: PHP Code: echo "<a href=\"delete.php?dir=$dir&file=$file\" onclick='return del(this, \"$id\")'><img src=\"images/delete.gif\" border=\"0\" /></a>"; However I seem to be struggling, severely! Any help would be greatly appreciated, especially if spelt out if alphabetti spaghetti. Kind Regards, Drew Hello, I have a form that calculates a dollar amount based on the percentage entered by the user. Now the client wants the form to also calculate the percentage if the user enters a dollar amount. I am new to this so I am having trouble figuring out how to format the if statement. Here is the code that performs the calculations: Code: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $(".TextBox").hover(function(){ $(this).toggleClass('TextBoxSelected'); },function(){ $(this).toggleClass('TextBoxSelected'); }).change(function(){ calculate(); }); }); function getFldValue(fldValue) { return isNaN(fldValue) ? 0 : parseFloat(fldValue); } function calculate() { var property_SPrice = getFldValue($('#property_SPrice').val()); var price = getFldValue($('#price').val()); var REO_sale_percentage = getFldValue($('#REO_sale_percentage').val()); var REO_sale_dollars = getFldValue($('#REO_sale_dollars').val()); var REO_sale_bonus_dollars = getFldValue($('#REO_sale_bonus_dollars').val()); var REO_sale_fixed_dollars = getFldValue($('#REO_sale_fixed_dollars').val()); var REO_sale_total_dollars = getFldValue($('#REO_sale_total_dollars').val()); var REO_list_percentage = getFldValue($('#REO_list_percentage').val()); var REO_list_dollars = getFldValue($('#REO_list_dollars').val()); var REO_list_bonus_dollars = getFldValue($('#REO_list_bonus_dollars').val()); var REO_list_fixed_dollars = getFldValue($('#REO_list_fixed_dollars').val()); var REO_list_total_dollars = getFldValue($('#REO_list_total_dollars').val()); var gr_comm_percentage = getFldValue($('#gr_comm_percentage').val()); var gr_comm_dollars = getFldValue($('#gr_comm_dollars').val()); var gr_bonus_dollars = getFldValue($('#gr_bonus_dollars').val()); var gr_fixed_dollars = getFldValue($('#gr_fixed_dollars').val()); var gr_total_dollars = getFldValue($('#gr_total_dollars').val()); $('#price').val(property_SPrice); $('#gr_comm_percentage').val(REO_list_percentage + REO_sale_percentage); $('#gr_comm_dollars').val(getFldValue(REO_list_dollars + REO_sale_dollars)); $('#REO_list_dollars').val(getFldValue(REO_list_percentage/100*price)); $('#REO_sale_dollars').val(getFldValue(REO_sale_percentage/100*price)); $('#gr_fixed_dollars').val(getFldValue(REO_list_fixed_dollars + REO_sale_fixed_dollars)); $('#gr_bonus_dollars').val(getFldValue(REO_list_bonus_dollars + REO_sale_bonus_dollars)); $('#gr_total_dollars').val(getFldValue(REO_sale_total_dollars + REO_list_total_dollars)); $('#REO_sale_total_dollars').val(getFldValue(REO_sale_dollars + REO_sale_fixed_dollars + REO_sale_bonus_dollars)); $('#REO_list_total_dollars').val(getFldValue(REO_list_dollars + REO_list_fixed_dollars + REO_list_bonus_dollars)); } </script> I now need to add: Code: $('#REO_list_percentage').val(getFldValue(REO_list_dollars/price*100)); $('#REO_sale_percentage').val(getFldValue(REO_sale_dollars/price*100)); So that if the user enters a dollar amount, the form can calculate the percentage along with all of the other calculations above. How would I write that? Thanks. I am using the Mega Menu from http://www.javascriptkit.com/script/...megamenu.shtml and need some assistance with an adjustment. The menu is working great as provided. However, we have a fairly wide menu layout and I have received comments that it is visually distracting to have the menu fly out horizontally. We want to have the menu start out full width and only animate to drop down vertically. Is this possible? If so, where in jkmegamenu.js would I make this adjustment? Thank you. Paul Hello everyone. First, if you do not understand something I have tried to explain, PLEASE ask, don't just skip the question! Thank you! I will start by explaining what I am doing and why I am running into a problem. Perhaps one of you kind people can help me figure out how to fix it. I have a grid set up for logic puzzle solving. The grid is made up of 3 rows of primary squares, each containing 16 sub-squares. The top row has 3 primary squares. the 2nd row has 2 primary squares. the 3rd row has 1 primary square. That gives a total of 96 sub-square, or grid coordinates. Each sub square has an image in it that can be altered by clicking the square. The image begins as a blank gif. With the first click, it becomes an X, with a second click, it becomes an O, and the third click returns it to blank. With me so far? Hope so! Now for the tricky part. The grid is made up using a table, with each TD having it's own identifier, as in: Code: a1b1 a1b2 a1b3 a1b4 | a1c1 a1c2 a1c3 a1c4 | a1d1 a1d2 a1d3 a1d4 a2b1 a2b2 a2b3 a2b4 | a2c1 a2c2 a2c3 a2c4 | a2d1 a2d2 a2d3 a2d4 a3b1 a3b2 a3b3 a3b4 | a3c1 a3c2 a3c3 a3c4 | a3d1 a3d2 a3d3 a3d4 a4b1 a4b2 a4b3 a4b4 | a4c1 a4c2 a4c3 a4c4 | a4d1 a4d2 a4d3 a4d4 ----------------------------------------- d1b1 d1b2 d1b3 d1b4 | d1c1 d1c2 d1c3 d1c4 d2b1 d2b2 d2b3 d2b4 | d2c1 d2c2 d2c3 d2c4 d3b1 d3b2 d3b3 d3b4 | d3c1 d3c2 d3c3 d3c4 d4b1 d4b2 d4b3 d4b4 | d4c1 d4c2 d4c3 d4c4 ----------------------------------------- c1b1 c1b2 c1b3 c1b4 c2b1 c2b2 c2b3 c2b4 c3b1 c3b2 c3b3 c3b4 c4b1 c4b2 c4b3 c4b4 Each sub-square also contains the image that is changed, and the image has it's own unique identifier, to go alone with the grid: Code: 1-0-0 | 1-0-1 | 1-0-2 | 1-0-3 | 1-1-0 |1-1-1 | 1-1-2 | 1-1-3 | 1-2-0 | 1-2-1 | 1-2-2 | 1-2-3 | ---------------------------------------------------------------------------------------------- 2-0-0 | 2-0-1 | 2-0-2 | 2-0-3 | 2-1-0 | 2-1-1 | 2-1-2 | 2-1-3 | 2-2-0 | 2-2-1 | 2-2-2 | 2-2-3 | ---------------------------------------------------------------------------------------------- 3-0-0 | 3-0-1 | 3-0-2 | 3-0-3 | 3-1-0 | 3-1-1 | 3-1-2 | 3-1-3 | 3-2-0 | 3-2-1 | 3-2-2 | 3-2-3 | ---------------------------------------------------------------------------------------------- 4-0-0 | 4-0-1 | 4-0-2 | 4-0-3 | 4-1-0 | 4-1-1 | 4-1-2 | 4-1-3 | 4-2-0 | 4-2-1 | 4-2-2 | 4-2-3 | ------------------------------------------------------------- 5-0-0 | 5-0-1 | 5-0-2 | 5-0-3 | 5-1-0 | 5-1-1 | 5-1-2 | 5-1-3 | ------------------------------------------------------------- 6-0-0 | 6-0-1 | 6-0-2 | 6-0-3 | 6-1-0 | 6-1-1 | 6-1-2 | 6-1-3 | ------------------------------------------------------------- 7-0-0 | 7-0-1 | 7-0-2 | 7-0-3 | 7-1-0 | 7-1-1 | 7-1-2 | 7-1-3 | ------------------------------------------------------------- 8-0-0 | 8-0-1 | 8-0-2 | 8-0-3 | 8-1-0 | 8-1-1 | 8-1-2 | 8-1-3 | ------------------------------ 9-0-0 | 9-0-1 | 9-0-2 | 9-0-3 | ------------------------------ 10-0-0 | 10-0-1 | 10-0-2 | 10-0-3 | ---------------------------------- 11-0-0 | 11-0-1 | 11-0-2 | 11-0-3 | ---------------------------------- 12-0-0 | 12-0-1 | 12-0-2 | 12-0-3 | Here is a sample of a TD including the image and other ID's: Code: <TD style=" border-bottom: 3px solid black;" class="gridoff" onMouseOver="className='gridon';" onMouseOut="className='gridoff';" id="gridtdD4C2"> <DIV align="center"> <IMG src="/testproject/n.gif" height="20" width="20" id="8-1-1" name="D4C2" onClick="flipBox(this);" class="gridbox"> </DIV> </TD> As you can see, the image ID is 8-1-1, which if you compare the two tables, is equal to D4C2. So far, everything is working perfect, as long as I have a grid that is 3x3x4, or, 3 squares across the top, 2 squares in the middles, and 1 square on the bottom, with 16 sub-squares in each. Now, the problem is, I do not always need a 3x3x4, sometimes I will need a 3x3x5, or a 4x4x4, or a 4x4x5 grid. I have made all the grids, and given them all the right ID's for both the TD, the IMG, as well as the <input> tags. When I test out a 3x3x5 grid, the first 4 columns in each square work fine, the 5th will only change to an X once, and cannot be changed again. Similarly, the first 4 rows in each square work, but not the 5th, with the same problem. Again, I have made sure that each of my ID's are correct, so that isn't the issue. The only thing I can figure it would be is the javascript. So, here it is, the script that does all the changes: Code: <SCRIPT LANGUAGE="JavaScript"> function checkDoubles(val) { // A4C5 = check A4C1, A4C2, A4C3, A4C4, A1C5, A2C5, A3C5, A5C5 var part1 = val.substr(0,1); var part2 = val.substr(1,1); var part3 = val.substr(2,1); var part4 = val.substr(3,1); var part12 = val.substr(0,2); var part34 = val.substr(2,2); var isdouble = "false"; // check A4C* for(i=1;i<5;i++) { var checkthisbox = part12 + part3 + i; if(checkthisbox!=val) { if(document.getElementById(checkthisbox).value==3) { alert("You can not set more than one box in any row to true at the same time! If you wish to set this box to true you must first remove the other true statement in this row."); var isdouble = "true"; } } } // check A*C5 for(i=1;i<5;i++) { var checkthisbox = part1 + i + part34; if(checkthisbox!=val) { if(document.getElementById(checkthisbox).value==3) { alert("You can not set more than one box in any column to true at the same time! If you wish to set this box to true you must first remove the other true statement in this column."); var isdouble = "true"; } } } return isdouble; } function flipBox(img) { var tmpname; if(img.src=="http://localhost/testproject/n.gif") { img.src = "http://localhost/testproject/x.gif"; tmpname = img.name; document.mainform.elements[tmpname].value = 1; document.getElementById(img.name).value = 1; } else if(img.src=="http://localhost/testproject/x.gif") { var finaltest = checkDoubles(img.name); if(finaltest=="false") { img.src = "http://localhost/testproject/o.gif"; tmpname = img.name; document.mainform.elements[tmpname].value = 3; document.getElementById(img.name).value = 3; } else { img.src = "http://localhost/testproject/n.gif"; } } else if(img.src=="http://localhost/testproject/o.gif") { img.src = "http://localhost/testproject/n.gif"; tmpname = img.name; document.mainform.elements[tmpname].value = 0; document.getElementById(img.name).value = 0; } showVals(); } </SCRIPT> I know nothing about javascript, so I have no idea why the grid is not working as it should. For some reason, 1-0-0 through 1-0-3 (A1B1 to A1B4) work, but 1-0-4 (A1B5) nor 5-0-4 (which would be A5B5 grid coord). It makes no sense to me. If you could please look over the script and tell me if you can see why it's letting the original part of the grid to work, but not the additional parts I add? Thank you! I've been working on this for a few days now and I'm not sure if it could be done or not. I'm trying to do the following complex formula in Adobe Acrobat. I want to be able to calculate tInterest (Total Interest Due) = fDays (# of days) * .0002739726 (interest rate) * PrincipalAmt (principal) but ONLY IF fDays > 90 or if CheckBox1 is checked then fDays > 180, otherwise tInterest = 0. See, I'm trying to create a form where the interest is only to be calculated if 90 days has elapsed OR 180 days has elapsed if checked off.Either way, interest is to be calculated from StartDate. Is this possible? |