JavaScript - Creating A Dynamic Update Link
Hello,
I'm trying to create a webpage where users can click on a dynamically generated set of questions: <?php do { ?> <p><?php echo $row_rsQuestions['question_text']; ?><?php echo $row_rsQuestions['question_type']; ?></p> <?php } while ($row_rsQuestions = mysql_fetch_assoc($rsQuestions)); ?> and by clicking on a particular question, there will be an update for their particular listing of personal questions in a MySql database. I know how to create the database update part, but I think that I would need to javascript to: 1) tell my page that it's time to update (i.e. add a particular question as soon as they click it) 2) pass along the correct variable to the database update portion of the page. Any help on these two items would be appreciated. Thank you! Similar Tutorialshi i am newbie to js please help me like a newbie thanks. i want to make a form. the form will have three text fields and with two buttons. what i want with this form is when the user enters the first three fields and if he wants to add more then he will click on add more button and on the same page three more fields will appear below the first three fields. the user will then enter these three fields then if he wants to add more then he will click on add more button. so three more fields will appear below the first six fields. user will enter these fields. he will be allowed to enter upto eight or less than eight times. once he finishes with this then he will click the second button to insert this data into db. Hi, I searched the web for a button that can be animated, as well as dynamic. but I couldn't find one, so I decided to try my hand at creating one. My method is similar to a post made by Bram2: http://codingforums.com/showthread.php?t=153326, however, I have found my code to be unreliable and it doesn't apply only to the area where the table is, instead of spreading across the screen. The reason for trying to create a button this way is because I'm lazy, I don't want to create a new button in a graphics editor, spending hours trying to make it uniform with the rest of the buttons on the page, every time I want a new button. Doing it this way will also enable to have buttons with mulitple lines of text. I am fairly new to javascript, so I am wondering if anyone can give me a hand making it more reliable or pointing me to a script that has already been created. I put the button Here instead of filling the post with code. Please look at it before telling me it can be done with the <button> tag, because I tried before posting here. thanks, grayatrox Edit:I have managed to get the code to do what I wanted it to do, and more efficently too. Old code is commented out in the orginal webpage. This is a working example on how to impliment the buttons. javascript: Code: /* Notes: - Each button MUST have a unique name. - You may need to create a secondary function that the button can activate like I did with the go(url) function below. - Email me (grayatrox) at 238atrox@gmail.com for bugs, or to suggest improvements. - Yes I know tables within tables is bad, if you read through my code carefully you will see where I am talking about. */ function loadButton() { //preload the buttons. image1 = new Image(); image1.src = "images/button_up_L.png"; //button up left image2 = new Image(); image2.src = "images/button_up_C.png"; //button up centre image3 = new Image(); image3.src = "images/button_up_R.png"; //button up right image4 = new Image(); image4.src = "images/button_down_L.png"; //button down left image5 = new Image(); image5.src = "images/button_down_C.png"; //button down centre image6 = new Image(); image6.src = "images/button_down_R.png"; //button down right } function createButton(buttonName, buttonText, buttonAction, id) { // create the code for a button output= "<table border='0' cellpadding='0' cellspacing='0' id="+buttonName+">"; output=output+"<tr name="+buttonName+" onclick=\""+buttonAction+"\" onmouseover=\"changeButton('down', '"+buttonName+"')\" onmouseout=\"changeButton('up', '"+buttonName+"')\">"; output=output+"<td align='right'><img id='"+buttonName+"_leftImage' src='images/button_up_L.png'/></td>"; output=output+"<td id='"+buttonName+"_middleImage' align='middle' background='images/button_up_C.png'/>"+buttonText+"</td>"; output=output+"<td align='left'><img id='"+buttonName+"_rightImage' src='images/button_up_R.png'/></td>"; output=output+"</tr>"; output=output+"</table>"; return output; } function writeButton(buttonName, buttonText, buttonAction) { // write button immediatly below where function has been called document.write(createButton(buttonName, buttonText, buttonAction)); } function writeButtonInId(buttonName, buttonText, buttonAction, id) { // write the button in an id document.getElementById(id).innerHTML=createButton(buttonName, buttonText, buttonAction); } function changeButton(action, name) { // button animation if (action== "up") { document.getElementById(name+'_leftImage').src="images/button_up_L.png"; document.getElementById(name+'_middleImage').style.backgroundImage ="url(images/button_up_C.png)"; document.getElementById(name+'_rightImage').src="images/button_up_R.png"; } else if (action== "down") { document.getElementById(name+'_leftImage').src="images/button_down_L.png"; document.getElementById(name+'_middleImage').style.backgroundImage ="url(images/button_down_C.png)"; document.getElementById(name+'_rightImage').src="images/button_down_R.png"; } } function go(url) { // written becuase there were too many ' and ". You can do this for any javascript function (I hope) document.location=url; } Hey all! So there I was newly hired and tasked with pouring through someone else's code to see what could be modified and brought up to date. After successfully finding the errors and correcting them and fulfilling the tasks my new supervisor assigned me, he slaps me on the back and says, "Well done! Now make it dynamic!" By which he meant the chapter buttons I spent hours creating from the existing code. Here's what he wants: the old code has an array, we'll call it someArray, that is assigned its values by the instructional developer as html pages are added to the course. So for example the code might look like this, Code: var someArray = new Array(4); someArray[0] = "video1/video1.html"; someArray[1] = "video2/video2.html"; someArray[2] = "video3/video3.html"; Now, each page has an associated chapter button. So video1/video1.html would have ch1Btn, video2/video2.html would have ch2Btn and so forth. Each button in turn calls a specific function which does only one thing - sets the currentPage variable to page associated with that button/array contents. For example, I have created the following functions to call each page: Code: function doCh1(){currentPage = 0; goToPage();} function doCh2(){currentPage = 1; goToPage();} function doCh3(){currentPage = 2; goToPage();} I should mention that all this is being done from within an html wrapper that calls each page into an iframe. The currentPage variable is assigned the url of one of the elements from the pageArray. My supervisor wants to be able to manually add pages to the pageArray and have the javascript code generate the associated buttons and function calls so when the learner clicks on one of the dynamically created buttons, s/he is taken to the correct page. Currently I'm using static images with the onclick calling the correct function to set my currentPage value and send the learner on his/her merry way. Is there a way to do all of this dynamically? If so, can you help me get my head around this by providing some examples? Sorry for the long post. Thank you, M My application reads an array of URLs in Javascript and displays them in a table. I need to create mouseover events for each of the links (just an alert message for now.) I have tried this a few ways, but for each one the mouseover event fires for each link before anything else is loaded on the page, and when the page is loaded, no link is displayed. Here are the two ways I've tried: Code: var cell1 = document.createElement("TD"); cell1.innerHTML = '<A HREF= ' + url + 'onMouseOver="' + alert("my alert box"); + '"> my page </A>'; Code: cell1.innerHTML = '<A HREF= "' + url + '"> my page </A>'; cell1.onMouseOver = alert('alert'); I have also tried many variations of these including: Code: cell1.innerHTML = '<A HREF= "' + url + '"> my page </A>'; cell1.onMouseOver = function(){alert('alert');}; Code: var cell1 = document.createElement("TD"); cell1.innerHTML = '<A HREF= " ' + url + ' " onMouseOver=" alert("my alert box"); "> my page </A>'; But they all yield the same result, so any help would be much appreciated! Hello everyone, I'm new to the programming world so please be kind I'm trying to find a code which would take the input value entered in a form field and on click direct you to a page which corresponds with what was entered. So for example: Enter "5" in field. Click Submit. Page opens up (which in fact would be an html file on my server called... 5.html) ( i would want to create 10 pages for values entered from 1-10... each value having a unique result when entered and clicked) I have no idea how to put this all together, i've been searching everywhere. Any kind of help would be appreciated. I would like to apologize in advance if my question sounds too simple. I am a novice to Javascript and have not had any real formal training here. I am creating a webpage which utilizes a separate .xml file to populate values in my webpage. This is my webpage (links.html): and here is my xml file (links_data.xml): This is my output: I have a link at the bottom of the page that points to the device being displayed. In this case, the link should be: http://10.90.139.201 If my xml file changes, it should point to the new IP address. My question is, how do I get the link to work? Currently, my current link (<a href="http://"IP_address"">Link</a>) does not populate any information. Appreciate any guidance here... thanks. I'm using a form data reference, something like P-1234 for example to create a text file and a link to the file. This is during the construction of a new table or table row with javascript. I have an array of one or more references submitted via form using $_POST. On my action page I am creating a txt file P-1234. If I am creating a table ot table row using createElement(), one of the cells will have a link to the file. If the file is created as follows: PHP Code: $File = $_POST['ref'][$i] . "txt"; After creating the cell Code: var Cell = document.createElement('td'); I assign the file to a variable var File = "<?= $File ?> "; I assume the link is inserted using innerHTML? If so, do I just append the filename to the end of the file path like this? Cell.innerHTML = "http://localhost/Project/+File"; If this is not the right way can someone point me in the right direction? Hi All, I tried to add links to open local xml files in browser in a dynamic table cells. I need help. I tried all ways but I think I miss something. I can open them without table just by document.write(xmlfile location). Here is my code. please help. function showResultsTable(searched, srchedname) { // get the reference for the body var mybody = document.getElementsByTagName("body")[0]; // creates a <table> element and a <tbody> element mytable = document.createElement("table"); mytable.setAttribute('id', 'resulttable'); mytablebody = document.createElement("tbody"); // creating all cells var mycurrent_cell = new Array(); for(var j = 0; j < srchedname.length; j++) { // creates a <tr> element mycurrent_row = document.createElement("tr"); mycurrent_cell[0] = document.createElement("td"); currenttext = document.createTextNode(j); mycurrent_cell[0].appendChild(currenttext); mycurrent_row.appendChild(mycurrent_cell[0]); mycurrent_cell[1] = document.createElement("td"); link = document.createElement("a"); link.name = ""+srchedname[j]); link.href = "C:\\AAA\\TestCasesList.xml"; mycurrent_cell[1].appendChild(link); mycurrent_row.appendChild(mycurrent_cell[1]); mycurrent_cell[2] = document.createElement("td"); currenttext = document.createTextNode(searched[j]); mycurrent_cell[2].appendChild(currenttext); mycurrent_row.appendChild(mycurrent_cell[2]); // appends the row <tr> into <tbody> mytablebody.appendChild(mycurrent_row); } // appends <tbody> into <table> mytable.appendChild(mytablebody); // appends <table> into <body> mybody.appendChild(mytable); // sets the border attribute of mytable to 2; mytable.setAttribute("border", "2"); } Hi, all! I'm a "fresh" newbie, JS self-taught from the great resources provided in this forum. I want to better currently working page but lack enough knowledge atm. The situation is this: * Multimedia database - audio clips and corresponding video clips to some of the audio ones. * Dynamic content page showing the latest (by date) 5 or 10 clips with their info from db. * Links provided for each clip, both to listen in a new popup window and to download the clip. Accomplished so far: everything of the above *only* for the audio clips (and video ones but separately on a different page). Every record in the data base has an audio clip and some of them, not all, have a video clip. E.g. there are records only with audio clips and there are records both with audio and video clips. My question is is it possible wherever there's a video clip in the db in an already displayed db-record on the page to display 'watch' and 'download' icon for it together with already shown audio icons ('listen' and 'download')? Conditional displaying. I read about combination between JS and CSS in almost similar situation but don't know how to apply it in my situation due to my little knowledge base at this moment. So, any help will be highly appreciated and useful as it will push me forward in learning JS. I'm almost sure this is possible as it's not a complicated issue. I can post my so far working code, if requested. If not provided enough info on the issue, let me know. Thank you in advance! Hi all, I think I have posted in the right place, if not appologies. Anyhow, I am currently creating a website for my canvas printing business and run into a few javascripting issues. I am trying to create a small navigation form whereby a customer can select from a dropdown the required width of canvas, this selection will then populate a second dropdown with a choice of canvas heights. Ok, so trawling many sites I came across some javascript that I was able to chop about and have this part sorted. The problem now is that I would like to include a submit button that when clicked takes the customer to a webpage based on their two dropdown choices, and being a complete newby when it comes to javascript I am stuck trying to include the script to enable this. eg: if they select '20" (51cm)' from the first dropdown and '16" (41cm)' from the second dropdown, they will navigate to "http: / / 20x16.co.uk" canvas print page. I have not currently created the canvas print pages so am unable to give the URLs of the pages. However if somebody can lend a hand to get me started and indicate where the desitnation URLs need to be added, I can drop these in later. The way that the script is currently written, the linked url could be based soley on the choice made in the second dropdown. I have a draft page with the working dropdowns he http://merchant.auctivacommerce.com/...iewtheme=32189 And the code that I currently have is: Code: <script type="text/javascript"> var SELECT_WIDTH_FIRST = []; var WIDTH08 = []; var WIDTH10 = []; var WIDTH12 = []; var WIDTH14 = []; var WIDTH16 = []; var WIDTH18 = []; var WIDTH20 = []; var WIDTH24 = []; var WIDTH30 = []; var WIDTH36 = []; var WIDTH42 = []; var WIDTH48 = []; var WIDTH60 = []; var WIDTH72 = []; SELECT_WIDTH_FIRST[0] = new Option("Please Select Width First", "SelWidFir"); WIDTH08[0] = new Option("8'' (20cm)", "0808"); WIDTH08[1] = new Option("10'' (25cm)", "0810"); WIDTH08[2] = new Option("12'' (30cm)", "0812"); WIDTH08[3] = new Option("14'' (35cm)", "0814"); WIDTH08[4] = new Option("16'' (41cm)", "8016"); WIDTH08[5] = new Option("18'' (46cm)", "0818"); WIDTH08[6] = new Option("20'' (51cm)", "0820"); WIDTH08[7] = new Option("24'' (61cm)", "0824"); WIDTH10[0] = new Option("8'' (20cm)", "1008"); WIDTH10[1] = new Option("10'' (25cm)", "1010"); WIDTH10[2] = new Option("12'' (30cm)", "1012"); WIDTH10[3] = new Option("14'' (35cm)", "1014"); WIDTH10[4] = new Option("16'' (41cm)", "1016"); WIDTH10[5] = new Option("18'' (45cm)", "1018"); WIDTH10[6] = new Option("20'' (51cm)", "1020"); WIDTH10[7] = new Option("24'' (61cm)", "1024"); WIDTH10[8] = new Option("30'' (76cm)", "1030"); WIDTH12[0] = new Option("8'' (20cm)", "1208"); WIDTH12[1] = new Option("10'' (25cm)", "1210"); WIDTH12[2] = new Option("12'' (30cm)", "1212"); WIDTH12[3] = new Option("14'' (35cm)", "1214"); WIDTH12[4] = new Option("16'' (41cm)", "1216"); WIDTH12[5] = new Option("18'' (45cm)", "1218"); WIDTH12[6] = new Option("20'' (51cm)", "1220"); WIDTH12[7] = new Option("24'' (61cm)", "1224"); WIDTH12[8] = new Option("30'' (76cm)", "1230"); WIDTH12[9] = new Option("36'' (91cm)", "1236"); WIDTH14[0] = new Option("8'' (20cm)", "1408"); WIDTH14[1] = new Option("10'' (25cm)", "1410"); WIDTH14[2] = new Option("12'' (30cm)", "1412"); WIDTH14[3] = new Option("14'' (35cm)", "1414"); WIDTH14[4] = new Option("16'' (41cm)", "1416"); WIDTH14[5] = new Option("18'' (45cm)", "1418"); WIDTH14[6] = new Option("20'' (51cm)", "1420"); WIDTH14[7] = new Option("24'' (61cm)", "1424"); WIDTH14[8] = new Option("30'' (76cm)", "1430"); WIDTH14[9] = new Option("36'' (91cm)", "1436"); WIDTH14[10] = new Option("42'' (107cm)", "1442"); WIDTH16[0] = new Option("8'' (20cm)", "1608"); WIDTH16[1] = new Option("10'' (25cm)", "1610"); WIDTH16[2] = new Option("12'' (30cm)", "1612"); WIDTH16[3] = new Option("14'' (35cm)", "1614"); WIDTH16[4] = new Option("16'' (41cm)", "1616"); WIDTH16[5] = new Option("18'' (45cm)", "1618"); WIDTH16[6] = new Option("20'' (51cm)", "1620"); WIDTH16[7] = new Option("24'' (61cm)", "1624"); WIDTH16[8] = new Option("30'' (76cm)", "1630"); WIDTH16[9] = new Option("36'' (91cm)", "1636"); WIDTH16[10] = new Option("42'' (107cm)", "1642"); WIDTH16[11] = new Option("48'' (122cm)", "1648"); WIDTH18[0] = new Option("8'' (20cm)", "1808"); WIDTH18[1] = new Option("10'' (25cm)", "1810"); WIDTH18[2] = new Option("12'' (30cm)", "1812"); WIDTH18[3] = new Option("14'' (35cm)", "1814"); WIDTH18[4] = new Option("16'' (41cm)", "1816"); WIDTH18[5] = new Option("18'' (45cm)", "1818"); WIDTH18[6] = new Option("20'' (51cm)", "1820"); WIDTH18[7] = new Option("24'' (61cm)", "1824"); WIDTH18[8] = new Option("30'' (76cm)", "1830"); WIDTH18[9] = new Option("36'' (91cm)", "1836"); WIDTH18[10] = new Option("42'' (107cm)", "1842"); WIDTH18[11] = new Option("48'' (122cm)", "1848"); WIDTH18[12] = new Option("60'' (152cm)", "1860"); WIDTH18[13] = new Option("72'' (183cm)", "1872"); WIDTH20[0] = new Option("8'' (20cm)", "2008"); WIDTH20[1] = new Option("10'' (25cm)", "2010"); WIDTH20[2] = new Option("12'' (30cm)", "2012"); WIDTH20[3] = new Option("14'' (35cm)", "2014"); WIDTH20[4] = new Option("16'' (41cm)", "2016"); WIDTH20[5] = new Option("18'' (45cm)", "2018"); WIDTH20[6] = new Option("20'' (51cm)", "2020"); WIDTH20[7] = new Option("24'' (61cm)", "2024"); WIDTH20[8] = new Option("30'' (76cm)", "2030"); WIDTH20[9] = new Option("36'' (91cm)", "2036"); WIDTH20[10] = new Option("42'' (107cm)", "2042"); WIDTH20[11] = new Option("48'' (122cm)", "2048"); WIDTH20[12] = new Option("60'' (152cm)", "2060"); WIDTH20[13] = new Option("72'' (183cm)", "2072"); WIDTH24[0] = new Option("8'' (20cm)", "2408"); WIDTH24[1] = new Option("10'' (25cm)", "2410"); WIDTH24[2] = new Option("12'' (30cm)", "2412"); WIDTH24[3] = new Option("14'' (35cm)", "2414"); WIDTH24[4] = new Option("16'' (41cm)", "2416"); WIDTH24[5] = new Option("18'' (45cm)", "2418"); WIDTH24[6] = new Option("20'' (51cm)", "2420"); WIDTH30[0] = new Option("10'' (25cm)", "3010"); WIDTH30[1] = new Option("12'' (30cm)", "3012"); WIDTH30[2] = new Option("14'' (35cm)", "3014"); WIDTH30[3] = new Option("16'' (41cm)", "3016"); WIDTH30[4] = new Option("18'' (45cm)", "3018"); WIDTH30[5] = new Option("20'' (51cm)", "3020"); WIDTH36[0] = new Option("12'' (30cm)", "3612"); WIDTH36[1] = new Option("14'' (35cm)", "3614"); WIDTH36[2] = new Option("16'' (41cm)", "3616"); WIDTH36[3] = new Option("18'' (45cm)", "3618"); WIDTH36[4] = new Option("20'' (51cm)", "3620"); WIDTH42[0] = new Option("14'' (35cm)", "3614"); WIDTH42[1] = new Option("16'' (41cm)", "3616"); WIDTH42[2] = new Option("18'' (45cm)", "3618"); WIDTH42[3] = new Option("20'' (51cm)", "3620"); WIDTH48[0] = new Option("16'' (41cm)", "4816"); WIDTH48[1] = new Option("18'' (45cm)", "4818"); WIDTH48[2] = new Option("20'' (51cm)", "4820"); WIDTH60[0] = new Option("18'' (45cm)", "6018"); WIDTH60[1] = new Option("20'' (51cm)", "6020"); WIDTH72[0] = new Option("18'' (45cm)", "7218"); WIDTH72[1] = new Option("20'' (51cm)", "7220"); function populateSub(mainSel, subSel){ var mainMenu = mainSel; var subMenu = subSel; var subMenuItems; subMenu.options.length = 1; switch (mainMenu.selectedIndex) { case 0: subMenuItems = SELECT_WIDTH_FIRST; break; case 1: subMenuItems = WIDTH08; break; case 2: subMenuItems = WIDTH10; break; case 3: subMenuItems = WIDTH12; break; case 4: subMenuItems = WIDTH14; break; case 5: subMenuItems = WIDTH16; break; case 6: subMenuItems = WIDTH18; break; case 7: subMenuItems = WIDTH20; break; case 8: subMenuItems = WIDTH24; break; case 9: subMenuItems = WIDTH30; break; case 10: subMenuItems = WIDTH36; break; case 11: subMenuItems = WIDTH42; break; case 12: subMenuItems = WIDTH48; break; case 13: subMenuItems = WIDTH60; break; case 14: subMenuItems = WIDTH72; break; } for (var i = 0; i < subMenuItems.length; i++) { subMenu.options[i] = subMenuItems[i]; } } </script> <div style="width:320px; text-align:right;"> <form name="Menus"> <label style="font-size:14px; font-variant:small-caps;">Width</label> <select style="width:250px; margin-bottom:10px;" name="Width" onchange="populateSub(this, this.form.Height);"> <option>Please Select</option> <option value="W08">8'' (20cm)</option> <option value="W10">10'' (25cm)</option> <option value="W12">12'' (30cm)</option> <option value="W14">14'' (35cm)</option> <option value="W16">16'' (41cm)</option> <option value="W18">18'' (46cm)</option> <option value="W20">20'' (51cm)</option> <option value="W24">24'' (61cm)</option> <option value="W30">30'' (61cm)</option> <option value="W36">36'' (61cm)</option> <option value="W42">42'' (61cm)</option> <option value="W48">48'' (61cm)</option> <option value="W60">60'' (61cm)</option> <option value="W72">72'' (61cm)</option> </select> <label style="font-size:14px; font-variant:small-caps;">Height</label> <select style="width:250px; margin-bottom:10px;" name="Height"> <option>Please Select Width First</option> </select> <input type="button" value="View Canvas!"> </form> </div> As mentioned, Javascript is completely new to me but I am attempting to learn. Any help would be greatly appreciated. Wayne Hi, I'm really new to Javascript. Recently in my IT class, we made a HTML page which would open a popup box, where the user could enter a key word. When the user pressed enter, the page would navigate to a specific page. The code we used was: Code: <script language = "JavaScript"> where = window.prompt ("Please tell me where you would like to go."); switch (where){ case "Digg" : window.location = "http://www.digg.com" ; break; default: window.location = "http://www.google.com" ; } </script> What I am hopeing to do, is implement this code on my workplaces server, and have the keywords link to other html documents within the server. However when I tested this, for some reason the links are not working. Can this actually be done? Am I missing something silly? Are there any other ways of doing this? Thanks in advance Hi All, i know how to create a dynamic form or DIv ..but what i do not know is how to create a dynamic form/ or div into a previous dynamic one.. i need basically to see 5 dynamic forms / DIV in cascade where each one trigger the one coming after.. For what i need that : i have my user inserting information on the level 1. let say Copagny info 2- then he will be asked if he wants to add a sub level information ( subform) for that compagny or even many subforms at the same level .. and so on... 3- those sub level ( subforms ) can also call their respective subforms.. Any idea how to design this ? thanks I have made a script where you can add extra fields, and next to the row is a span that automatically displays the outcome from a calculation of three fields in that row. i.e. Q x (B - A) = total. Here is the bit that does the calculation: Code: function advCalc(selected) { var result = Number(document.formmain.elements["quantity"+selected].value) * (Number(document.formmain.elements["provideamount"+selected].value) - Number(document.formmain.elements["supplyamount"+selected].value)) ; result = result.toFixed(2) ; result = addCommas(result) ; document.getElementById("total"+selected).innerHTML = result ; } The bit that adds a new row of fields is: Code: function addPart(divName){ var newdiv = document.createElement('div') ; newdiv.setAttribute('id', 'partrow' + counter) ; newdiv.setAttribute('style', 'clear:both;') ; newdiv.innerHTML = "<div style='float:left;width:40px;text-align:center;margin:5px 5px 0px 0px;'>\r<input onkeyup=\"advCalc('" + counter + "')\" id=' quantity " + counter + "' type='text' value='1' size='1'/>\r</div>\r<div style='float:left;width:100px;text-align:left;margin:5px 0px 0px 0px;'>\r<input id='manufacturer" + counter + "'type='text' value='' size='9'/>\r</div>\r<div style='float:left;width:95px;text-align:left;margin:5px 5px 0px 0px;'>\r<input id='partnumber" + counter + "'type='text' value='' size='9'/>\r</div>\r<div style='float:left;width:80px;text-align:left;margin:5px 5px 0px 0px;'>\r<input id='supplier" + counter + "'type='text' value='' size='4'/>\r</div>\r<div style='float:left;width:100px;text-align:left;margin:5px 5px 0px 0px;'>\r<input id='type" + counter + "'type='text' value='' size='6'/>\r</div>\r<div style='float:left;width:85px;text-align:left;margin:5px 5px 0px 0px;'>\r<input id='deliverytime" + counter + "'type='text' value='' size='13'/>\r</div>\r<div style='float:left;width:40px;text-align:left;margin:5px 0px 0px 45px;'>\r<select id='supplyCurrency" + counter + "'>\r<option value='pound' selected='selected'>£</option><option value='dol'>$</option><option value='euro'>€</option></select>\r</div>\r<div style='float:left;width:15px;text-align:left;margin:5px 5px 0px 0px;'>\r<input onkeyup=\"advCalc(\'" + counter + "\')\" id=' supplyamount " + counter + "'type='text' value='' size='3'/>\r</div>\r<div style='float:left;width:40px;text-align:left;margin:5px 0px 0px 45px;'>\r<select name='provideCurrency" + counter + "'><option value='pound' selected='selected'>£</option><option value='dol'>$</option><option value='euro'>€</option></select>\r</div>\r<div style='float:left;width:15px;text-align:left;margin:5px 5px 0px 0px;'>\r<input onkeyup=\"advCalc(\'" + counter + "\') id=' provideamount " + counter + "' type='text' value='' size='3'/>\r</div>\r<div style='float:left;width:20px;text-align:left;margin:5px 0px 0px 45px;'>\r<strong>£</strong>\r</div>\r<div style='float:left;width:40px;text-align:left;margin:5px 5px 0px 0px;'><span id=' total " + counter + "'></span></div> \r" ; document.getElementById(divName).appendChild(newdiv) ; counter++ ; } The problem I am having is that it works fine for the first row which is hardcoded as e.g. id="provideamount0" etc. It isn't working for any other fields added but I can't see what is wrong I'm working on a technical document that has a glossary section. When I use a technical term, I link to its definition in the glossary then provide a return link to return the user to whence they came. But if I use that same term again, and if I want to link it to the glossary, I need to duplicate the glossary entry in order to provide a return link that returns them to the right place. Is there some way I could link them to the glossary and embed a unique return link in the link to the glossary?
I've been using this slidehsow but each time I click on a link (Newsflash) it goes to yahoo.com, even though each link goes to a different website, it looks like the last link of the last slidehsow is the one which controls all the slidehsow links link of slidshow as you can see from the code each link for each slidehsow should go to a diffrent website. Code: <div class="lof-main-outer"> <ul class="lof-main-wapper"> <li> <img src="images/791902news3.jpg" title="Newsflash 2" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 2" href="http://www.google.com">Newsflash 2</a></h3> <p>The one thing about a Web site, it always changes! Joomla! makes it easy to add Articles, content,...</p> </div> </li> <li> <img src="images/435576news10.jpg" title="Newsflash 1" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 1" href="http://www.gmx.com">Newsflash 1</a></h3> <p>Joomla! makes it easy to launch a Web site of any kind. Whether you want a brochure site or you are...</p> </div> </li> <li> <img src="images/641906img1.jpg" title="Newsflash 3" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 3" href="www.godaddy.com">Newsflash 3</a></h3> <p>With a library of thousands of free Extensions, you can add what you need as your site grows. Don't...</p> </div> </li> <li> <img src="images/416719news7.jpg" title="Newsflash 5" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 5" href="http://www.flickr.com">Newsflash 5</a></h3> <p>Joomla! 1.5 - 'Experience the Freedom'!. It has never been easier to create your own dynamic Web...</p> </div> </li> <li> <img src="images/416719news7.jpg" title="Newsflash 5" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 5" href="http://www.intel.com">Newsflash 5</a></h3> <p>Joomla! 1.5 - 'Experience the Freedom'!. It has never been easier to create your own dynamic Web...</p> </div> </li> <li> <img src="images/416719news7.jpg" title="Newsflash 5" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 5" href="http://www.yahoo.com">Newsflash 5</a></h3> <p>Joomla! 1.5 - 'Experience the Freedom'!. It has never been easier to create your own dynamic Web...</p> </div> </li> </ul> </div> I have a dynamic website where my client can upload pictures to, i have php dynamically show the images and etc, i also have php assign each photo an id number. Basically what it is each photo dynamically gets id=$i++. So every photo uploaded it goes up one higher. Now i wanted to make it so in javascript the same happens, the id is dynamically i++ but im not very good in javascript so i was hoping i could get some help. Basically i want it to be something like this. (unless u know a better way of doing the same kind of effect) Code: var i=0; $(document) .ready(function(){ setTimeout(function () {$("#i++").fadeOut("slow");}, 100); setTimeout(function () {$("#i++").fadeIn("fast");}, 400); }); I just need help getting the i++ to work. Hello all. I am currently viewing various reports based on a location chosen by a dropdown. When I select GO, the page sends the location to a popup, which then queries based on that location and displays the graph on the popup window. What I want to do is to eliminate the popup and send the location to a <div> on the same page and then have the query run and display the graph on the same page. Is this possible, or do Divs have to be static content? Thanks, Parallon Hi i am looking to create a js pop up to display an amazon widget which relates to an item on my page. so i've found this on the net http://blazonry.com/javascript/windows.php but im not very javascript minded and dont know where to start. so i have tried this Code: <img src="images/listen.png" border="0" alt="Preview Songs" title="Preview Songs" onclick="window.open("song_preview.php?id=<?php echo $row['ASIN']?>","Window1","menubar=no,width=430,height=360,toolbar=no");" /> but it loads a blank pop up at the same time the page loads up and not when an image is clicked? plus when i first loaded the page it said pop up blocked which sucks!! on the example i didnt get that, any reason why??? any help is appreciated thanks Luke |