JavaScript - Script To Populate A Div Or Remove What's There.
I have a check box right now that calls an onClick event.
Here is the Input: Code: <input name="usePad" type="checkbox" value="usePad" id="usePad" onclick="showBind('padShow','padOk')" /> Here is the Script: Code: var xmlhttpshowBind; var showBindDiv; function showBind(BindPage,BindDiv) { xmlhttpshowBind=GetXmlHttpObject(); if (xmlhttpshowBind==null) { alert ("Browser does not support HTTP Request"); return; } var url="/scripts/"+BindPage+".php"; showBindDiv=BindDiv; xmlhttpshowBind.onreadystatechange=showBindGet; xmlhttpshowBind.open("GET",url,true); xmlhttpshowBind.send(null); } function showBindGet() { if (xmlhttpshowBind.readyState==4) { document.getElementById(showBindDiv).innerHTML=xmlhttpshowBind.responseText; } } It works great to fill the div called for, but I would like it to remove the div contents if it's unchecked, I'm not sure how to do this?? Any help would be appreciated! Thank you in advance! Similar TutorialsTotal newbie, I (almost) know just basic HTML. I have my own website and I'm trying to find out how to make a popup window work from clicking on a part link in a parent window table so that my clients can make an inquiry. I have about 300 parts on 10 pages total and would like it to be something I can just enter the new varibles on the parent page and the code takes care of the rest. I would like the popup to have the part info as a variable from the table as a variable in the inquiry page header and also part description as a variable the hidden subject line. I have included the code I already have and I'm looking for the script to bring it all together. Example for header may read "Part 1" for example and the hidden subject variable to read "0001 Part 1 $20" for example. I hope this is possible and I hope I made sense. I really need help me with this. Parent page Code: <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Parts Page</title> <link rel="stylesheet" type="text/css" href="../styles.css" /> <style type="text/css">body{font-family: Verdana, sans-serif;font-size: 14px;font-style: normal;line-height: normal;font-weight: normal;color: #000000;}</style> </head> <body> <div align="center"><table width="90%" style="border-collapse:collapse;" border="1" cellpadding="2"> <tr><td width="15%"><h2 align="center">Item #</h2><p align="center">Click to inquire</p></td> <td width="60%"><h2 align="center">Description - Used OEM Parts*</h2><p align="center">*Unless described differently</p></td> <td width="15%" valign="top"><h2 align="center">Coverage</h2><p align="center">*Sorted by Year</p></td> <td width="10%" valign="top"><h2 align="center">Price</h2></td></tr> <tr><td align="center"><a href="mailto:myemail@myweb.com?subject=0001 - My Part 1 - $20"><font size="2">0001</font></a></td><td align="left"><font size="2">My part 1</font></td><td align="center"><font size="2">1960-61</font></td><td align="center"><font size="2">$20</font></td></tr> <tr><td align="center"><a href="mailto:myemail@myweb.com?subject=0002 - My Part 2 - $25"><font size="2">0002</font></a></td><td align="left"><font size="2">My part 2</font></td><td align="center"><font size="2">1960-61</font></td><td align="center"><font size="2">$25</font></td></tr> </table></div> </body> Popup window Code: <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Parts Inquiry</title> <link rel="stylesheet" type="text/css" href="../styles.css" /> <style type="text/css">body{font-family: Verdana, sans-serif;font-size: 14px;font-style: normal;line-height: normal;font-weight: normal;color: #000000;}</style> </head> <body> <form action="http://www.myweb.com/cgi/FormMail.pl" method="post"> <input type="hidden" name="recipient" value="myemail@myweb.com" /> <input type="hidden" name="subject" value="variable 2" /> <input type="hidden" name="redirect" value="http://myemail@myweb.com/used_parts/thank_you6.html" /> <input type="hidden" name="required" value="realname, email" /> <input type="hidden" name="env_report" value="REMOTE_HOST, HTTP_USER_AGENT, REMOTE_USER, REMOTE_ADDR " /> <div align="center"><table width="90%" border="0"> <tr><td align="center"><h1>variable 1</h1> <p align="center"><font size="2" color="#FF0000">"*" Indicates required field.</font></p> <p><font>Fill out the form below to find out more about this this part.</font></p> </td></tr></table></div> <div align="center"><table width="50%" border="2" bgcolor="#99CCFF"> <tr><td align="right" width="50%"><font color="#FF0000">*</font>Your Name : </td> <td align="left" width="50%"><input type="text" size="35" maxlength="256" name="realname" /></td></tr> <tr><td align="right" width="50%"><font color="#FF0000">*</font>Email Address : </td> <td align="left" width="50%"><input type="text" size="35" maxlength="256" name="email" /></td></tr> <tr><td align="right" width="50%">Phone Number : </td> <td align="left" width="50%"><input type="text" size="14" maxlength="256" name="Phone" /></td></tr> <tr><th colspan="2">Please type your question(s) in the space below: <textarea name="Question(s)" rows="5" cols="70"></textarea></th></tr></table></div><br /> <div align="center"><table width="90%" border="0"> <tr><td align="center"> <input type="submit" value="Submit Form" /> <input type="reset" value="Clear Form" /> </td></tr></table></div></form> </body> I also have some parameters for the desired popup window size and position. Code: width=625,height=450,left=275,top=100,resizable=no,status=no,toolbar=no,menubar=no,location=no'); Any other suggestions for the popup window parameters would be welcome! Thanks, John I'm working on a webpage where I used this code to display random images. I used it for three images in a row and I keep getting white spacing in between them when they should be right up against each other. This is the code I'm using: Code: <script language="JavaScript"> <!-- /* Random Image Script- By JavaScript Kit (http://www.javascriptkit.com) Over 400+ free JavaScripts here! Keep this notice intact please */ function random_imglink(){ var myimagesblue=new Array() //specify random images below. You can have as many as you wish myimagesblue[1]="images/circles_blue/circle_bl_01.jpg" myimagesblue[2]="images/circles_blue/circle_bl_02.jpg" myimagesblue[3]="images/circles_blue/circle_bl_03.jpg" myimagesblue[4]="images/circles_blue/circle_bl_04.jpg" myimagesblue[5]="images/circles_blue/circle_bl_05.jpg" myimagesblue[6]="images/circles_blue/circle_bl_06.jpg" myimagesblue[7]="images/circles_blue/circle_bl_07.jpg" myimagesblue[8]="images/circles_blue/circle_bl_08.jpg" myimagesblue[9]="images/circles_blue/circle_bl_09.jpg" myimagesblue[10]="images/circles_blue/circle_bl_10.jpg" myimagesblue[11]="images/circles_blue/circle_bl_11.jpg" var ry=Math.floor(Math.random()*myimagesblue.length) if (ry==0) ry=1 document.write('<img src="'+myimagesblue[ry]+'" border=0>') } random_imglink() //--> </script> Is there a way to get the white space removed? Thanks Hi, I have a regular expression which removes anything between <script> and </script> tags. The problem comes when there is more than one on a page, eg. Code: <script>lose this</script> content I want to keep <script>lose this</script> Everything in that string is removed... how can I limit it to complete tags only? I did a search but could only find ones that either remove tags only, or have the same problem as mine. Cheers, Gus Hi, I got this two javascripts: - Datepicker by Jason Moon (http://calendar.moonscript.com/dateinput.cfm) which can have multiple of this datepicker on a single form - Dynamic Add/Remove rows from http://viralpatel.net/blogs/2009/03/...avascript.html I would like to add rows of fields with each rows having it's individual datepicker. Code: <table id="billcmp_7" width="320" border="0"> <tr> <td width="200" align="center"><script>DateInput('billcmp7_cycle', true)</script></td> <td width="10"> </td> <td width="100" align="center"><input name="billcmp7_name" type="text" /></td> <td width="10"><INPUT type="checkbox" name="chk"/></td> </tr> </table> <table width="320" border="0"> <tr> <td colspan="4" align="center"><INPUT type="button" value="Add Row" onclick="addRow('billcmp_7')" /><INPUT type="button" value="Delete Row" onclick="deleteRow('billcmp_7')" /></td> </tr> </table> I just want this section Code: <script>DateInput('billcmp7_cycle', true)</script> to work like Code: <script>DateInput('billcmp7_cycle_1', false)</script> <script>DateInput('billcmp7_cycle_2', false)</script> when click on the add button. Here's what i meant? Link cant get the time to be different as it is still read as single datepicker. Any1 has any idea how or any alternative? Hello, I am new to Javascript. I copied this script from the web, but I get an error at this line: parent.removeChild(child); The error says "Invalid argument". Any suggestions are greatly appreciated. Code: <div id="parent" align=center> <form name=mainfrm method=post> <script language="JavaScript"> function doDelete(str1,str2) { var parent = document.getElementById(str1); var child = document.getElementById(str2); parent.removeChild(child); alert ("box removed"); } </script> <br><br> <table> <td class=stdbut1 onmouseover="this.className='stdbut1on'" onClick="doDelete('parent','child');" onmouseout="this.className='stdbut1'">Delete Box</td> </table> <br><br> <div id="child" class=titlebox1>Box</div> </form> </div> I am trying to populate a listbox using Javascript. The listbox is populated using the xml response from ajax request. Below is the code used for the same Code: var xmlDoc = xmlhttp.responseXML; for (var i = 0; i < xmlDoc.getElementsByTagName("id").length; i++) { traderlists.add(new Option(xmlDoc.getElementsByTagName("name")[i].childNodes[0].nodeValue, xmlDoc.getElementsByTagName("id")[i].childNodes[0].nodeValue)); } This works fine for me. But i am facing performance issue here. some ajax requests retrieves xmls with around 11,000 nodes and this takes too much of time to populate the listbox. Can anyone please advice me with an better solution? Resolution if interested: Code: <head> <title>Lab8</title> <script src="arrays.js" type="text/javascript"></script> <link href="css.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> function amountTotal() { var totalDonations = 0; for (var i = 0; i < amount.length; i++) { totalDonations += amount[i]; } return totalDonations; } </script> </head> <body> <table id="donations" rules="rows"> <tr> <th> Date </th> <th> Name </th> <th> Amount </th> <th> Address </th> </tr> <script type="text/javascript"> for (var i = 0; i < amount.length; i++) { if (i % 2 == 0) document.write("<tr>") else document.write("<tr class='yellowrow'>"); document.write("<td>" + date[i] + "</td>"); document.write("<td>" + firstName[i] + lastName[i] + "</td>"); document.write("<td>" + amount[i] + "</td>"); document.write("<td>" + street[i] + "<br />" + city[i] + "," + " " + state[i] + " " + zip[i] + "</td>"); } document.write("</tr>") </script> </table> <table id="totalsTable"> <tr> <th colspan="2"> Summary </th> </tr> <tr> <td> Contributions </td> <td class="amt"> <script type="text/javascript"> document.write(amount.length); </script> </td> </tr> <tr> <td> Amount </td> <td class="amt">$ <script type="text/javascript"> var totalTotal = amountTotal(); document.write(totalTotal); </script> </td> </tr> </table> </body> </html> I have a seperate .js sheet with some arrays on them (firstName, lastName, date, amount, city, state, zip) and I am trying to populate a table with these indexes. The 'yellowrow' highlights everyother row which is called out in my css sheet. My header rows fill in but not the rest. Here is the link for the site actually posted on the web. Code: <body> <table id="donations" rules="rows"> <tr> <th>Date</th> <th>Name</th> <th>Amount</th> <th>Address</th> </tr> <script type="text/javascript"> for (var i = 0; i < amount.length; i++) { if (i % 2 == 0) document.write("<tr>") else document.write("<tr class='yellowrow'>"); document.write("<td>" + date(i) + "</td>"); document.write("<td>" + firstName(i) + lastName(i) + "</td>"); document.write("<td>" + amount(i) + "</td>"); document.write("<td>" + "<br />" + city(i) + "," + state(i) + zip(i) + "</td>"); } document.write("</tr>") </script> </table> </body> I have a div what will contain a various number on images and i need to put all their src's into an array. Is this doable? Heres the code Code: <div id="imageHolder"> <!-- ONLY CHANGE THE SRC, NOTHING ELSE --> <div style="width:770px;height:400px;overflow-y:auto;margin-bottom:5px;"> <img src="http://wholesalepadlocks.co.uk/ebayImages/AU080.JPG" alt="" width="750" id="mainImage"/><br /><br /> </div> <img src="http://wholesalepadlocks.co.uk/ebayImages/au080a.jpg" alt="" width="240" height="120" onmouseover="Images = this.src;alert(Images)" /> <img src="http://wholesalepadlocks.co.uk/ebayImages/au080b.jpg" alt="" width="240" height="120" onmouseover="Images = this.src;alert(Images)"/> <img src="http://wholesalepadlocks.co.uk/ebayImages/AU080.JPG" alt="" width="240" height="120" onmouseover="Images = this.src;alert(Images)"/> </div>Ignore the onmouseover code i was attempting to do this but so far no luck :P <!-- *** NEED HELP PASSING VALUE id TO POPULATE SUBRECORDS *** --> <!-- *** See line #51 to #55 *** --> <?php session_start(); ob_start(); if($_SESSION[userdetails]->role != "Admin") { die("Access Denied!"); } require_once("includes/connect.php"); // Check if he has the right info. $sql = sprintf("SELECT * FROM members ORDER BY username ASC", $_SESSION[userdetails]->id); $query = mysql_query($sql); // You are now connected ?> <head> <html> <head> <title>Split ListBox Text To Text Boxes</title> <script type="text/javascript"> <!-- archaic format: language="javascript" --> function SplitText (info) { if (info == '') { return; } var tarr = info.split(","); document.getElementById('tBox1').value = tarr[0]; document.getElementById('tBox2').value = tarr[1]; document.getElementById('tBox3').value = tarr[2]; document.getElementById('tBox4').value = tarr[3]; } </script> </head> <body> <form name="convert"> <p style="margin: 2px"> <p><select name="Groups" style="width: 176; height: 19; border: 1px solid #C0C0C0 ; font-size: 11px; font-family:Arial" size="1" onChange="SplitText(this.value)"> <option>===Select Group===</option> <?php $sql1 = mysql_query("SELECT * FROM qw_groups"); while($r1=mysql_fetch_assoc($sql1)){ $f1 = $r1[id]; $f2 = $r1[GroupName]; echo "<option value='$f1,$f2,,'>$f2</option>"; } echo "</select>"; ?> <p><select name="GroupItems" style="width: 176; height: 19; border: 1px solid #C0C0C0 ; font-size: 11px; font-family:Arial" size="1" onChange="SplitText(this.value)"> <option>===Select Group Item===</option> <?php // **** IS IT POSSIBLE TO PASS THE VALUE "$f1" FROM GROUPS TO GROUPITEMS **** // **** I WANT TO POPULATE THE SECOND DROPDOWN LIST WITH SUB-RECORDS WITHOUT SUBMIT /POST /REFRESH /OR RELOAD **** // WHERE id = $f1 ?? maybe some java code id = $val onChange ?? $sql2 = mysql_query("SELECT * FROM qw_groupitems WHERE id = $f1"); while($r2=mysql_fetch_assoc($sql2)){ $f3 = $r2[Subid]; $f4 = $r2[GroupItem]; echo "<option value='$f1,$f2,$f3,$f4'>$f4</option>"; } echo "</select>"; ?> </p> <!-- Input selected data from listBox --> <p style="margin: 2px"> <input type="text" name="textbox1" id="tBox1" value=""><br> <input type="text" name="textbox2" id="tBox2" value=""><br> <input type="text" name="textbox3" id="tBox3" value=""><br> <input type="text" name="textbox4" id="tBox4" value=""><br> </p> </form> </body> </html> hello i am trying to fire a form which after the call to retrieve the data, populate the form with the data. i can see from firebug that the json data is being captured, but cannot seem to be able to populate the form with it. i am using a jquery plugin facybox, that opens the form, but the fields are blank. i have attached my code and would be grateful if someone could tell me where i am going wrong? many thanks js code Code: <script type="text/javascript"> function edit(com, grid) { if (com == 'Edit') { if($('.trSelected').length>0){ if($('.trSelected').length>1){ alert('Please select just one row'); return; } var items = $('.trSelected'); var itemlist =''; for(i=0;i<items.length;i++){ itemlist+= items[i].id.substr(3); } $.ajax({ type: "POST", dataType: "json", url: "tempcontact.php", data: "items="+itemlist, success: function(data){ document.getElementById('id').value = data.id; document.getElementById('email').value = data.email; $("#flex1").flexReload(); } }); /*and so on then you can call facybox*/ jQuery.facybox({ div: "#editform"}); } else{ alert('Please select a row to edit.'); } } } </script> form Code: <div id="editform" style="display:none;"> <form action="conedit.php" method="post" class="webform"> <fieldset> <legend><span>Update Contact</span></legend> <br /> <div id="dataText">Please delete the fields if there is no data 'No data to display'.</div> <label for="id">ID:</label> <input id="id" name="id" class="text" type="text" value="" /> <label for="name">Full Name:</label> <input id="name" name="name" class="text" type="text" value="" /> <label for="email">Email address:</label> <input id="email" name="email" class="text" type="text" value="" /> <label for="phone">Telephone:</label> <input id="phone" name="phone" class="text" type="text" value="" /> <label for="mobile">Mobile:</label> <input id="mobile" name="mobile" class="text" type="text" value="" /> <label for="fax">Fax:</label> <input id="fax" name="fax" class="text" type="text" value="" /> <label for="notes">Notes:</label> <textarea name="notes" cols="25" rows="3"></textarea> </fieldset> <input class="submit" type="submit" name="submit" value="Update" /> </form> </div> Hello guys, How to populate array from dropdownlist? I've tried like this var array = new array(); var d = document.getElementById("DropDownListl"); for (var i = 0; i < d.options.length; i++) { array[i] = d.options[i].value; } Thank you I really need help with this. I really don't know how to make this work. I need to populate a drop down menu with a value passed through the browser if it's passed. so the browser URL will look like: domain.com/?referer=YellowPagesOnline I need to capture the referer value from the browser store it into a cookie. If the cookie is set and then populate the drop down on the page with the cookie. If it's not set then a list of sources should appear. So I already have the code to grab the string and store it in a cookie but I'm not sure how to do the initialization of the drop down with the cookie value. This is what I have... Code: <script> //Get the referer string out of the URL function getQuerystring(key, default_) { if (default_==null) default_=""; key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regex = new RegExp("[\\?&]"+key+"=([^&#]*)"); var qs = regex.exec(window.location.href); if(qs == null) return default_; else return qs[1]; } //Set the cookie for 30 days function SetCookie(cookieName,cookieValue,nDays) { var today = new Date(); var expire = new Date(); if (nDays==null || nDays==0) nDays=1; /* expire.setTime(today.getTime() + 3600000*24*nDays);*/ expire.setTime(today.getTime() + (1000 * 60 * 60 * 24 * 30)); document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString(); } //Put the cookie on the user's computer function putcookie() { var val = getQuerystring('referer'); if(val !=""){ if (document.cookie.length == 0) { SetCookie('referer', val, 1); alert(val); } } alert(document.cookie); } putcookie(); getCookie(name); //If there is a cookie then get the cookie function getCookie(c_name) { if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + "="); if (c_start!=-1) { c_start=c_start + c_name.length+1; c_end=document.cookie.indexOf(";",c_start); if (c_end==-1) c_end=document.cookie.length; if(document.SECatJax.referer.length > 0) { document.SECatJax.referer.value = unescape(document.cookie.substring(c_start,c_end)); return false; } alert(document.cookie); } } document.SECatJax.referer.value = 'Website'; } The dropdown to appear if there isn't a cookie is Code: <select name="source_code" size="1" id="source_code" class="select_2" style="display:none"> <option value="" selected="selected">--</option> <option value="Direct Mail">Direct Mail</option> <option value="High School Presentation">High School Presentation</option> <option value="Search Engine">Internet Search</option> <option value="Newspaper">Newspaper</option> <option value="Poster">Poster</option> <option value="Radio">Radio</option> <option value="Referral">Referral</option> <option value="TV">TV</option> <option value="Yellow Pages">Yellow Pages</option> </select> The drop down to appear if there is a cookie is[CODE]<select name="source_code2" size="1" id="source_code2" class="select_2" style="display:none"> <option value="YellowPagesOnline" selected="selected">YellowPagesOnline</option> </select>[CODE] Can someone help me with this please? Thanks. Hi, I'm working on a menu update form. I'm pulling the existing data from mysql and posting it into a form, using php. This works fine. But now I want the user to be able to modify the data and perform and update query to the database with the changes. I cannot figure out how to get the modified php text box data into my html form text boxes so I can run an update query. I would be ok with a button that transfers the php text box data to the html form data. Hope this is clear what I'm trying to do, seems simple enough, but I can't figure it out. Thanks in advance for any ideas. I have a page where a user can enter info into a text box named (usertext). Below the box I have a link that takes the user to another page. This page is just a test page for proof of concept. I am wondering if there is a way that I can dynamically populate a variable located within the url of my link. The info that will populate the variable will be whatever the user types into the text box. For example my link will be <a href="nextpage.cfm?textvariable='#usertext#'> So when the user clicks this link, it goes to the next page already populated by the value of the info the user typed into the text box. I am thinking javascript will be involved, but I am not really sure. I am using coldfusion 8. Hi, I have these two pages which I want to link...the index.html is the main page. I want the list.html page to pop up when names is clicked..Then I want to be able to select all or some of the name from the list.html page and inset into the textbox on the index.html page, separated by commas with the list.html closing on insert. hope my ambition is clear enough... index.html PHP Code: <body> Add contacts:<br /> <input name="" type="text" /><br /> <a href="list.html" target="_new">names </a> </body> list.html PHP Code: <body> Contact list:<br /> <form id="form1" name="form1" method="post" action=""> <p> <input type="checkbox" name="checkbox" id="checkbox" /> Paul<br /> <input type="checkbox" name="checkbox" id="checkbox" /> Matthew<br /> <input type="checkbox" name="checkbox" id="checkbox" /> Philip<br /> <input type="checkbox" name="checkbox" id="checkbox" /> Grant </p> <p> <input type="submit" name="button" id="button" value="Insert" /> <br /> </p> </form> <br /> </body> A simple solution will greatly be appreciated .... thanks Hi guys, I am facing the above problem for a chatroom app that I am making. People will enter and exit the room any time they want, so i need a member list that updates itself to reflect this on the screen of all users that are in the chatroom. What i have thought of, is to have JS call a PHP function on specific intervals, and that PHP function will retrieve user data from a database and pass it to JS to display on the list. Is this method advisable? Are there any more suitable ways of doing this? I am thinking of applying the same theory for displaying and retrieving chat messages, but i get the feeling that something's missing for this, or maybe this method is not right for displaying messages. Hi, How can I auto populate the data by dropdown selected? and my dropdown result already appear as well, the code as following: PHP Code: <?php echo '<tr> <td>'.$customer_data.'</td> <td><select name="customer_id">'; foreach ($customers as $customer) { if ($customer['customer_id'] == $customer_id) { echo '<option value="'.$customer['customer_id'].'" selected="selected">'.$customer['name'].'</option>'; } else { echo '<option value="'.$customer['customer_id'].'">'.$customer['name'].'</option>'; } } echo '</select> </td> </tr>'; ?> and the result of dropdown above listed as admin customer1 FREE loaded from following db PHP Code: INSERT INTO `my_customer` (`customer_id`, `name`, `firstname`, `lastname`) VALUES (8, 'admin', '', ''), (6, 'customer1', 'ok', ''), (7, 'FREE', 'marj', 'om'); so whenever dropdown selected i want the all data below: PHP Code: <tr> <td><?php echo $firstname; ?></td> <td><?php echo $lastname; ?></td> </tr> also auto populate, it seem need javascript/ajax/jquery to fixed it, I was Wondering if someone could help me, and thanks in advance I have a web form that requests a user full name and email address. What I would like to do is when the user fills in the full name in one input box, I would like to take the full name and populate the email address field as such. "first.last@allstate.com". So pretty much split the full name and popluate email address field "first.last@allstate.com". Tracy I have two slightly different forms on the same page, but I want the values in form1 to auto populate the same form fields in form2. 1 field is a text field, the rest are drop down menus. How would I accomplish this? Link to tutorial would be much appreciated. Thanks
Need help with a loop to populate links menu from external page. I am trying to auto populate a links menu from an external page without manually changing them. My menu has 12 categorys and I would like to retreive 4 links in each category from an external page, selecting a category brings up a page with 4 to 10 links in the selected category. In the code below category number1 has been selected. please help me with a loop to auto populate the links in 12 categorys with 4 links each...even if only one category is populated after manual category selection would still be a big help. Thanks Code: /* ---------------------------------------external articles------------------------------ */ /* -------------item/category selection 1 thru 12 --------------------*/ <td class="num">1.</td><td class="selected">num1</td></tr> <tr><td class="num">2.</td><td><a href="">selected page link</a></td></tr> <tr><td class="num">3.</td><td><a href="">selected page link</a></td></tr> <tr><td class="num">4.</td><td><a href="">selected page link</a></td></tr> <tr><td class="num">5.</td><td><a href="">selected page link</a></td></tr> <tr><td class="num">6.</td><td><a href="">selected page link</a></td></tr> <tr><td class="num">7.</td><td><a href="">selected page link</a></td></tr> <tr><td class="num">8.</td><td><a href="">selected page link</a></td></tr> <tr><td class="num">9.</td><td><a href="">selected page link</a></td></tr> <tr><td class="num">10.</td><td><a href="">selected page link</a></td></tr> <tr><td class="num">11.</td><td><a href="">selected page link</a></td></tr> <tr><td class="num">12.</td><td><a href="">selected page link</a> /* -------------end item/category selection 1 thru 12 --------------------*/ /* ---------------------------external page with news atricles--------------- */ <b>News Articles</b> <div class="msc-result"> <div class="ms-newsResult ms-result"> <div class="ms-title"><a target="_blank" class="ms-title" href="http://www.xyz.com">bla bla:<b>keyword</b>short description</a></div> <div class="ms-publisher">xyz News</div> <div class="ms-publishedDate"> - Aug 05, 2011</div> <div class="ms-relativePublishedDate"> - 8 hours ago</div> <div class="ms-snippet">headline<b>keyword</b>description text<b>...</b></div> <div class="ms-watermark"><a target="_blank" class="ms-watermark" href="http://xyz.com/faq.html">clipped from my articles - 8/2011</a></div></div></div> <div class="msc-result"> <div class="ms-newsResult ms-result"> <div class="ms-title"><a target="_blank" class="ms-title" href="http://www.xyz.com">bla bla: <b>keyword</b>short description</a></div> <div class="ms-publisher">xyz News</div> <div class="ms-publishedDate"> - Aug 05, 2011</div> <div class="ms-relativePublishedDate"> - 8 hours ago</div> <div class="ms-snippet">headline<b>keyword</b>description text<b>...</b></div> <div class="ms-watermark"><a target="_blank" class="ms-watermark" href="http://xyz.com/faq.html">clipped from my articles - 8/2011</a></div></div></div> <div class="msc-result"> <div class="ms-newsResult ms-result"> <div class="ms-title"><a target="_blank" class="ms-title" href="http://www.xyz.com">bla bla: <b>keyword</b>short description</a></div> <div class="ms-publisher">xyz News</div> <div class="ms-publishedDate"> - Aug 05, 2011</div> <div class="ms-relativePublishedDate"> - 8 hours ago</div> <div class="ms-snippet">headline<b>keyword</b>description text<b>...</b></div> <div class="ms-watermark"><a target="_blank" class="ms-watermark" href="http://xyz.com/faq.html">clipped from my articles - 8/2011</a></div></div></div> <div class="msc-result"> <div class="ms-newsResult ms-result"> <div class="ms-title"><a target="_blank" class="ms-title" href="http://www.xyz.com">bla bla: <b>keyword</b>short description</a></div> <div class="ms-publisher">xyz News</div> <div class="ms-publishedDate"> - Aug 05, 2011</div> <div class="ms-relativePublishedDate"> - 8 hours ago</div> <div class="ms-snippet">headline<b>keyword</b>description text<b>...</b></div> <div class="ms-watermark"><a target="_blank" class="ms-watermark" href="http://xyz.com/faq.html">clipped from my articles - 8/2011</a></div></div></div> <div class="msc-result"> <div class="ms-newsResult ms-result"> <div class="ms-title"><a target="_blank" class="ms-title" href="http://www.xyz.com">bla bla: <b>keyword</b>short description</a></div> <div class="ms-publisher">xyz News</div> <div class="ms-publishedDate"> - Aug 05, 2011</div> <div class="ms-relativePublishedDate"> - 8 hours ago</div> <div class="ms-snippet">headline<b>keyword</b>description text<b>...</b></div> <div class="ms-watermark"><a target="_blank" class="ms-watermark" href="http://xyz.com/faq.html">clipped from my articles - 8/2011</a></div></div></div> /* ---------------------------------------end external articles------------------------------ */ /* -----------------display links page (ms publisher) will be link text---------------- */ /* -----------------Category is num1 thru 12 selection at top---------------- */ <div id="my_menu"> <ul> <li><a href=""><img src=""; /> </a></li> <ul></ul> <li><a href="#">Article category / keyword</a> <ul> <li><a href="" target="news">link text</a></li> <li><a href="" target="news">link text</a></li> <li><a href="" target="news">link text</a></li> <li><a href="" target="news">link text</a></li> </ul> </li> <li><a href="#">Article category / keyword</a> <ul> <li><a href="" target="news">link text</a></li> <li><a href="" target="news">link text</a></li> <li><a href="" target="news">link text</a></li> <li><a href="" target="news">link text</a></li> </ul> </li> <li><a href="#">Article category / keyword</a> <ul> <li><a href="" target="news">link text</a></li> <li><a href="" target="news">link text</a></li> <li><a href="" target="news">link text</a></li> <li><a href="" target="news">link text</a></li> </ul> </li> <li><a href="#">Article category / keyword</a> <ul> <li><a href="" target="news">link text</a></li> <li><a href="" target="news">link text</a></li> <li><a href="" target="news">link text</a></li> <li><a href="" target="news">link text</a></li> </ul> </li> !-- END MENU HTML--> </div> <div id="contentContainer"> </div> Thanks |