JavaScript - Populate An Array With Image Src's
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 Similar TutorialsI am working on a page where the user will select a location from a dynamically generated dropdown list. I was able to create the php multidimensional array (tested and working) from a MySql database using the users information at login, but I'm having problems converting it to a javascript multidimensional array. I need to be able to access variables that I can pass to a number of text fields within an html form. For instance, if a user belongs to a company with multiple addresses, I need to be able to let them select the address they need to prepopulate specific text fields. php array creation: Code: if ($row_locations) { while ($row_locations = mysql_fetch_assoc($locations)) { $mail[$row_locations['comp_id']]=array('mailto'=>$row_locations['mailto'], 'madd'=>$row_locations['madd'], 'madd2'=>$row_locations['madd2'], 'mcity'=>$row_locations['mcity'], 'mstate'=>$row_locations['mstate'], 'mzip'=>$row_locations['mzip'], 'billto'=>$row_locations['billto'], 'badd'=>$row_locations['badd'], 'badd2'=>$row_locations['badd2'], 'bcity'=>$row_locations['bcity'], 'bstate'=>$row_locations['bstate'], 'bzip'=>$row_locations['bzip']); } } javascript function - this should create the array and send variables to text fields. Code: function updateAddress() { var mail = $.parseJSON(<?php print json_encode(json_encode($mail)); ?>); { if (comp_id in mail) { document.getElementById('mailto').value=mail.comp_id.mailto.value; document.getElementById('madd').value=mail.comp_id.madd.value; document.getElementById('madd2').value=mail.comp_id.madd2.value; document.getElementById('mcity').value=mail.comp_id.mcity.value; document.getElementById('mstate').value=mail.comp_id.mstate.value; document.getElementById('mzip').value=mail.comp_id.mzip.value; } else { document.getElementById('mailto').value=''; document.getElementById('madd').value=''; document.getElementById('madd2').value=''; document.getElementById('mcity').value=''; document.getElementById('mstate').value=''; document.getElementById('mzip').value=''; } } } Where is this breaking? Thanks in advance. 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 want to use arrays to populate an HTML list. I can populate the main list items but I can't seem to get the sub list items to work. Can anyone point out my mistake? Code: <HTML> <Body> <ul> <script> var pages = ["page1", "page2","page3"]; var subPages = ["sub1","sub2"]; for(var i = 0; i < pages.length; i++){ var page = pages[i]; document.write('<li>' + page + '</li>'); if (page == "page2"){ document.write('<ul>'); for(var i = 0; i < subPages.length; i++){ var subPage = subPages[i]; document.write('<li>' + subPage + '</li>'); } document.write('</ul'>); } } </script> </ul> </body> </HTML> I would like to set up an image gallery so that when customer clicks on their chosen image, the image caption populates into the associated field in the form below the gallery, on the same page. Any way you know of to do this? I am not really a coder, I only know this and that, so examples or detailed instructions will be most helpful. Thanks very much. 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 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! <!-- *** 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> 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. 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> 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 I have a table where when the cursor passes/hovers over a cell, the current cell, as well as the top cell in its column and the first cell in its row change backgroundColor. I have text fields outside the table which I want to populate with the contents of the cells affected by the mouseover event. So as the mouse moves over different cells, the contents of the text fields changes accordingly. I've got the backgroundColor to change, but when I try to assign the contents of the cells to the text fields, nothing happens. The change of backgroundColor even stops working. This is the code I'm usign to populate the fields. Code: document.getElementById("tableID").textfieldID.value = Col1Cell[0].innerHTML; document.getElementById("tableID").textfieldID.value = HeaderCell[n].innerHTML; document.getElementById("tableID").textfieldID.value = this.innerHTML; I'm traversing through the <th> and <td> tags to find the header cell HeaderCell[n] and first column cell Col1Cell[0] associated with the current cell. If I leave out these lines the backgroundColor changes, if I use them, nothing happens at all. Can't figure out why. Any suggestions? Hi All, My first question on this forum. I have a form where we are capturing the Members Children information. I want to insert age in years to a field within this table by calculating age from Date of Birth (DOB). DOB format is mm/dd/yyyy and is a datetime data type in SQL. The DOB is added by the member while registering their child. Is there an onchange script that I could use here. Is it possible to auto populate a field from an other field within the same form?? Does anyone have any code samples that I could use?? Any pointers will be greatly appreciated. Thanks Vinny Hello, I need your help. I'd like to be able to populate a combo box (drop down box) from a column in my mdb database: Ex. of whats in mdb database Name -------------- Joey Jacob Smith Jerrod Patrick What should appear in drop down: [ ==== COMBO BOX ==== ] Joey Jacob Smith Jerrod Patrick I cant seem to find any help on the web for this? Thanks for all your help in advance. 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
Please help. I'm not sure why it's not populating. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Blood Control</title> <meta name="keywords" content=""> <meta name="description" content=""> <META HTTP-EQUIV="Expires" CONTENT="0"> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <!--- global javascript functions ---> <script language="JavaScript" type="text/javascript" src="https://www.bd.com/includes/global.js"></script> <!--- global style sheet ---> <LINK rel="stylesheet" type="text/css" href="https://www.bd.com/includes/styles.css" media="screen"> <!--- print style sheet ---> <LINK rel="stylesheet" type="text/css" href="https://www.bd.com/includes/print.css" media="print"> <!--- browser specific style sheets ---> <STYLE TYPE="text/css"> BODY { font-size: 75%; font-family : Verdana, Arial, Helvetica; color: #333333; } TD { font-size: 75%; font-family : Verdana, Arial, Helvetica; color: #333333; } </STYLE> <!----- HBX Include -----> <!-- HBX INCLUDE DATA HERE www.bd.com --> <!--WEBSIDESTORY CODE HBX1.0 (Universal)--> <!--COPYRIGHT 1997-2005 WEBSIDESTORY,INC. ALL RIGHTS RESERVED. U.S.PATENT No. 6,393,479B1. MORE INFO:http://websidestory.com/privacy--> <script language="javascript"> var _hbEC=0,_hbE=new Array;function _hbEvent(a,b){b=_hbE[_hbEC++]=new Object();b._N=a;b._C=0;return b;} var hbx=_hbEvent("pv");hbx.vpc="HBX0100u";hbx.gn="aa.bd.com"; //BEGIN EDITABLE SECTION //CONFIGURATION VARIABLES hbx.acct="DM531126I7FB72EN3";//ACCOUNT NUMBER(S) hbx.pn="PUT+PAGE+NAME+HERE";//PAGE NAME(S) hbx.mlc="CONTENT+CATEGORY";//MULTI-LEVEL CONTENT CATEGORY hbx.pndef="index.asp";//DEFAULT PAGE NAME hbx.ctdef="full";//DEFAULT CONTENT CATEGORY //OPTIONAL PAGE VARIABLES //ACTION SETTINGS hbx.fv="";//FORM VALIDATION MINIMUM ELEMENTS OR SUBMIT FUNCTION NAME hbx.lt="auto";//LINK TRACKING hbx.dlf="n";//DOWNLOAD FILTER hbx.dft="n";//DOWNLOAD FILE NAMING hbx.elf="n";//EXIT LINK FILTER hbx.lc="y";//FORCE LOWERCASE //SEGMENTS AND FUNNELS hbx.seg="";//VISITOR SEGMENTATION hbx.fnl="";//FUNNELS //CAMPAIGNS hbx.cmp="";//CAMPAIGN ID hbx.cmpn="";//CAMPAIGN ID IN QUERY hbx.dcmp="";//DYNAMIC CAMPAIGN ID hbx.dcmpn="";//DYNAMIC CAMPAIGN ID IN QUERY hbx.dcmpe="";//DYNAMIC CAMPAIGN EXPIRATION hbx.dcmpre="";//DYNAMIC CAMPAIGN RESPONSE EXPIRATION hbx.hra="";//RESPONSE ATTRIBUTE hbx.hqsr="";//RESPONSE ATTRIBUTE IN REFERRAL QUERY hbx.hqsp="";//RESPONSE ATTRIBUTE IN QUERY hbx.hlt="";//LEAD TRACKING hbx.hla="";//LEAD ATTRIBUTE hbx.gp="";//CAMPAIGN GOAL hbx.gpn="";//CAMPAIGN GOAL IN QUERY hbx.hcn="";//CONVERSION ATTRIBUTE hbx.hcv="";//CONVERSION VALUE hbx.cp="";//LEGACY CAMPAIGN hbx.cpd="";//CAMPAIGN DOMAIN //CUSTOM VARIABLES hbx.ci="";//CUSTOMER ID hbx.hc1="";//CUSTOM 1 hbx.hc2="";//CUSTOM 2 hbx.hc3="";//CUSTOM 3 hbx.hc4="";//CUSTOM 4 hbx.hrf="";//CUSTOM REFERRER hbx.pec="";//ERROR CODES //INSERT CUSTOM EVENTS //END EDITABLE SECTION //REQUIRED SECTION. CHANGE "YOURSERVER" TO VALID LOCATION ON YOUR WEB SERVER (HTTPS IF FROM SECURE SERVER) </script> <script language="javascript1.1" src="https://www.bd.com/includes/hbx.js"></script> <!--END WEBSIDESTORY CODE--> <!----- WT Include -----> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="javascript"> var rand_no = Math.floor(Math.random()*999999); // Declaring required variables var digits = "0123456789"; // non-digit characters which are allowed in phone numbers var phoneNumberDelimiters = "()#- ."; // characters which are allowed in international phone numbers // (a leading + is OK) var validWorldPhoneChars = phoneNumberDelimiters + "+"; // Minimum no of digits in an international phone no. var minDigitsInIPhoneNumber = 0; function form_action(form) { if (form.Share_Story.checked) { document.getElementById('share_story_enabled').style.display = 'block'; } else { document.getElementById('share_story_enabled').style.display = 'none'; } if (form.Share_Comment.checked) { document.getElementById('share_comment_enabled').style.display = 'block'; } else { document.getElementById('share_comment_enabled').style.display = 'none'; } if (form.Sign_Up.checked) { document.getElementById('sign_up_enabled').style.display = 'block'; } else { document.getElementById('sign_up_enabled').style.display = 'none'; } } </script> <script language="javascript"> function clearselect() { document.myform.State.options.length = 0; } function changeStates() { var indx=document.myform.Country.selectedIndex var Country=document.myform.Country.options[indx].value if (Country=="United States") { clearselect(); document.myform.State.options[0] = new Option('----- Select One -----',''); document.myform.State.options[1] = new Option('Alabama','AB'); document.myform.State.options[2] = new Option('Alaska','AK'); document.myform.State.options[3] = new Option('Arizona','AZ'); document.myform.State.options[4] = new Option('Arkansas','AR'); document.myform.State.options[5] = new Option('California','CA'); document.myform.State.options[6] = new Option('Colorado','CO'); document.myform.State.options[7] = new Option('Connecticut','CT'); document.myform.State.options[8] = new Option('Delaware','DE'); document.myform.State.options[9] = new Option('District of Columbia','DC'); document.myform.State.options[10] = new Option('Florida','FL'); document.myform.State.options[11] = new Option('Georgia','GA'); document.myform.State.options[12] = new Option('Hawaii','HI'); document.myform.State.options[13] = new Option('Idaho','ID'); document.myform.State.options[14] = new Option('Illinois','IL'); document.myform.State.options[15] = new Option('Indiana','IN'); document.myform.State.options[16] = new Option('Iowa','IA'); document.myform.State.options[17] = new Option('Kansas','KS'); document.myform.State.options[18] = new Option('Kentucky','KY'); document.myform.State.options[19] = new Option('Louisiana','LA'); document.myform.State.options[20] = new Option('Maine','ME'); document.myform.State.options[21] = new Option('Maryland','MD'); document.myform.State.options[22] = new Option('Massachusetts','MA'); document.myform.State.options[23] = new Option('Michigan','MI'); document.myform.State.options[24] = new Option('Minnesota','MN'); document.myform.State.options[25] = new Option('Mississippi','MS'); document.myform.State.options[26] = new Option('Missouri','MO'); document.myform.State.options[27] = new Option('Montana','MT'); document.myform.State.options[28] = new Option('Nebraska','NE'); document.myform.State.options[29] = new Option('Nevada','NV'); document.myform.State.options[30] = new Option('New Hampshire','NH'); document.myform.State.options[31] = new Option('New Jersey','NJ'); document.myform.State.options[32] = new Option('New Mexico','NM'); document.myform.State.options[33] = new Option('New York','NY'); document.myform.State.options[34] = new Option('North Carolina','NC'); document.myform.State.options[35] = new Option('North Dakota','ND'); document.myform.State.options[36] = new Option('Ohio','OH'); document.myform.State.options[37] = new Option('Oklahoma','OK'); document.myform.State.options[38] = new Option('Oregon','OR'); document.myform.State.options[39] = new Option('Pennsylvania','PA'); document.myform.State.options[40] = new Option('Puerto Rico','PR'); document.myform.State.options[41] = new Option('Rhode Island','RI'); document.myform.State.options[42] = new Option('South Carolina','SC'); document.myform.State.options[43] = new Option('South Dakota','SD'); document.myform.State.options[44] = new Option('Tennessee','TN'); document.myform.State.options[45] = new Option('Texas','TX'); document.myform.State.options[46] = new Option('Utah','UT'); document.myform.State.options[47] = new Option('Vermont','VT'); document.myform.State.options[48] = new Option('Virginia','VA'); document.myform.State.options[49] = new Option('Washington','WA'); document.myform.State.options[50] = new Option('West Virginia','WV'); document.myform.State.options[51] = new Option('Wisconsin','WI'); document.myform.State.options[52] = new Option('Wyoming','WY'); } else if (Country=="Canada") { clearselect(); document.myform.State.options[0] = new Option('---------------Select One-------------',''); document.myform.State.options[1] = new Option('Alberta','AB'); document.myform.State.options[2] = new Option('British Columbia','BC'); document.myform.State.options[3] = new Option('Manitoba','MB'); document.myform.State.options[4] = new Option('New Brunswick','NB'); document.myform.State.options[5] = new Option('New Foundland','NL'); document.myform.State.options[6] = new Option('NorthWest Territories','NT'); document.myform.State.options[7] = new Option('Nova Scotia','NS'); document.myform.State.options[8] = new Option('Ontario','ON'); document.myform.State.options[9] = new Option('Prince Edward Island','PE'); document.myform.State.options[10] = new Option('Quebec','QC'); document.myform.State.options[11] = new Option('Saskatchewan','SK'); document.myform.State.options[12] = new Option('Yukon','YT'); } else if (Country!="Canada" && Country!="United States") { clearselect(); document.myform.State.options[0] = new Option('Not Applicable','Not Applicable'); } } </script> </head> <body bgcolor="#ECF3FB" link="#2F61BD" vlink="#2F61BD" alink="#FF6600" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" onLoad="pageLoaded();"> <table border=0 cellpadding=0 cellspacing=0 width=768 align="center" bgcolor="#FFFFFF"> <tr> <td width=4 height=7 background="https://www.bd.com/images/shadow_left.gif" valign=top><img src="https://www.bd.com/images/shadow_top_left.gif" alt="[spacer image]" width="4" height="7" hspace="0" vspace="0" border="0"></td> <td width=760 rowspan=2 valign=top><!--- Global Header Include ---> <script type="text/javascript" src="https://www.bd.com/includes/anylink.js"> /*********************************************** * AnyLink CSS Menu script- © Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code ***********************************************/ </script> 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. Total 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 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 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 |