JavaScript - Print Option On A Popup Box ?
hey there i was wondering if anyone knows how to get a print option button in a pop up window , i am using html with javascript to create a currency converter i have a button on my main page which opens up a popup window with information taken and totalled from the user input , i would like to be able to offer the option to print this window off .
code is function open_win(){ myWindow=window.open('','','width=300,height=300'); myWindow.document.write("<p>Current sterling recieved</p>",sterling_total,"<p>Total commision recieved</p>",commision_total,"<p>Total Money Recieved</p>",running_total); myWindow.focus(); } Similar TutorialsI have created a page where everytime the page loads a popup window opens and diplays a message. This is done through javascripting. After the message is read the reader can close the window. The popup page is an actual html page and not a dialog box. This is fine except, everytime the visitor comes back to that page the window pops up. Is there a way to hve it where I can insert a link or button that says "Don't show message again" . That way it will pop up the first time but if the reader clicks that "Don't show message again" it will not appear again. Maybe set some sort of cookie. HELP ME PLEASE
Hello all, I am currently looking to create a JavaScript menu for a website I am working on. It currently expands and collapses on click. The code in question is pasted below:- menu_status = new Array(); function showHide(theid){ if (document.getElementById) { var switch_id = document.getElementById(theid); if(menu_status[theid] != 'show') { switch_id.className = 'show'; menu_status[theid] = 'show'; }else{ switch_id.className = 'hide'; menu_status[theid] = 'hide'; } } } As you can see, it basically shows and hides the menu (when clicked). I want it to open the menu when clicked and close when another menu is opened. I have looked and have not been able to find a solution into it. Ideally I donot want it to be a long piece of code as I do have a working menu but with many more lines of JavaScript than the one I have posted. I need a solution to it urgently, your help is appreciated. Thanks Hi, I'm kinda hoping this is possible but haven't found any reference to it... I have a parent page that opens a popup on click that launches a sidebar navigation on the right of the screen and resizes the parent page. What I am wanting to do is create a second popup (approx 250px high) that opens below the navigation (which is only around 600px high) but I have noticed that even when you have no status bar in the popup windows, they can still end up overlapping because of additional tools or plugins that the viewer has in their browser. Is there any way to get the popups to butt up against each other instead of overlapping? More like a relative popup? Any assistance would be appreciated. :-) Hi Guys, A bit stuck here and was wondering what you guys think. I have an HTML Select Option with a list of countries. A user saves that page and when he wants to return to the same page later at some point, i would like to populate the countries drop down list with what he entered initially. Is there an easy way to do this? Thanks. Hello according to this http://www.w3schools.com/php/php_ajax_database.asp I prepared mine search which works fine. it displays which products are intel and which amd for example. I wonder how can i add a second similar search for sochet or something else,but not separate one for example if i have selected the intel as 1st option then choosing my 2nd one it display only intel products. Here is my current code: Code: <script type="text/javascript"> function showUser(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","kailoipa.php?q="+str,true); xmlhttp.send(); } </script> </head> <body> <form> <select name="products" onchange="showUser(this.value)"> <option value="">Select a person:</option> <option value="intel">intel</option> <option value="amd">amd</option> </select> </form> <br /> <div id="txtHint"><b>Person info will be listed here.</b></div> </body> </html> Hi!, I use this option transfer example for my php& mysql web... http://www.developergeekresources.co...to_listbox.php I wanted to know how can i get a value from this ? as a example i need to get first 3 values after transferred.... How can i do this ? Thanks HI All, I am using triple ajax dropdwon in my php file.In my form i have species_scientifc_name & on select I am sending its id to a php file for retriving data for second dependent dropdown box, Here I need to get this id in form action file. How to get this value, Any idea? Thnaks in Advance!! Hey guys, I recently found a small code in internet which use option value in select tag to insert value in text box, so text box has the exact same value as selected option: Code: <form name="theform" onsubmit="CheckForm()"> <select name="myOptions" onchange="document.theform.showValue.value=this.value"> <option name="(some dynamic text)" id="(some dynamic text)" value="I am the first option">I am the first option</option> <option name="(some dynamic text)" id="(some dynamic text)" value="I am the second option">I am the second option</option> <option name="(some dynamic text)" id="(some dynamic text)" value="I am the third option">I am the third option</option> <option name="(some dynamic text)" id=""(some dynamic text)" value="I am the third option">I am the fourth third option</option> </select> <input type="text" name="showValue"><br> </form> Now what I want is simple and a little different from this one, I want the text box value to be as exact as selected option name or id (doesn't matter which one) which means if an option selected, text box value has to follow that option name or id. Thanks folks. Hello, I have a shopping cart that calculates shipping on products based on weight. What I'm wanting to do is use Javascript to scan the contents of the visitors shopping cart for a particular word, as well as scan the quantity of the product in the cart. The condition: If the product name = some string I want to compare AND if the quantity < some number I want to compare. If these two conditions are met, I wan't to hide a shipping option called 'Free Shipping' once the user clicks the Estimate Shipping & Tax button. Here is a link to the websites cart.php page: All Commercial Furniture.com - Shopping Cart The platform we use is a little limited, so they don't give us access to their PHP files. Having to find a workaround for right now. Please let me know if you need any info. Any point in the right direction would be great. Thanks Hello Everyone! It's been a while since this thought started to bother me, I would like to create a website that has script which depending on the option chooses the image and merges with the other image. My idea is that someone comes on my website which would be custom carp hair rings. They would have options such as: Hook type Hook size Braid(fishing line) Length of the braid Swivel So depending on the hook they choose different image will appear and depending on the braid and the hook size everything merges together into finished product where the outcome you could clearly see the image of the hook tied with braid and a swivel at the end. This is the image Basically where you see the hook, the customer could select from an option of hooks and it would be replaced by their option, the length of the bread doesn't matter, but it would be nice to have some sort of an indicator to the customer how long it would be, and the last bit is the swivel, depending on the option the customer chooses, he can see the swivel or not. Its like creating your own carp rig, you choose which hook you want, then it appears, you choose which braid you want, it appears and if you want you can have a swivel at the end and you can see how your chosen options looks like in reality. Now I do not ask anyone to do everything for me, all I'm asking is for directions. Is there a script somewhere that I could edit that would achieve my goal, since I have no coding skills but some knowledge it would be nice to get some support along the way. Thank You for you attention Arnoldas Valys Hi All, I need to replace the dropdown option values when a different dropdown value is changed. I am calling the javascript function with onChange successfully, but I'm struggling to make the changes. Original Code: <select name="People"> <option value="A">Person A</option> <option value="B">Person B</option> <option value="C">Person C</option> </select> Change to Code: <select name="People"> <option value="X">Person X</option> <option value="Y">Person Y</option> <option value="Z">Person Z</option> </select> Can someone provide an example? Thanks You in Advance for Your Help! Hello. Could anyone help me with this? I understand how to use OnChange with select boxes to allow the page to be redirected when certain options are selected, such as; Code: <select onchange="window.open(this.options[this.selectedIndex].value,'_top')"> <option value="">Choose a destination...</option> <option value="http://www.yahoo.com/">YAHOO</option> <option value="http://www.google.com/">GOOGLE</option> <option value="http://www.altavista.com/">ALTAVISTA</option> <option value="http://www.amazon.com/">AMAZON</option> <option value="http://artlung.com/">ARTLUNG</option> </select> However, I would like the page to only be redirected when just one option (out of 3) are chosen... and when the other two are chosen, we remain on the same page. such as; Code: <select onchange="window.open(this.options[this.selectedIndex].value,'_top')"> <option value="">Choose an option...</option> <option value="tonight">TONIGHT</option> <option value="tomorrow">TOMORROW</option> <option value="http://mysite.com/selectdate">SELECT DATE</option> </select> is this possible? Many Thanks, Patrick. Hello, I have some database widgets. I want the user to be able to mouseover the widget and see a popup window of a synopsis of the database. If the user would like to access the database, I would like them to have the onClick option. <head> [CODE] <script> function openPopUp(URL) { new_window = window.open(URL, 'window', 'toolbar=0,scrollbars=0,location=0, statusbar=0,menubar=0,resizable=0,width=650,height=300,left = 350,top = 280'); } function closePopUp() { new_window.close(); } </script> [CODE] <Body> [CODE] <a href="#" onMouseOver="openPopUp('http://jpl.coj.net/res/db/popups/abc-clio.html')" onMouseOut="closePopUp(''http://jpl.coj.net/res/db/popups/abc-clio.html')"><img src="http://jpl.coj.net/pics/logos/abc-clio.jpg" alt="ABC-CLIO Databases" width="164" height="42" border="0"/></a> <URL of database> http://databases.abc-clio.com/Multi/ Can this be done? Thank you for your help, Elbee So I have two for loops that check to see if each array item * a number returns a decimal. Here is my code(Cred to Philip M): Code: var myArray = f; for (var wi=0; wi<myArray.length; wi++) { var warray = myArray[wi]; var wabs = Math.abs((warray*z1)) if (!(wabs > Math.floor(warray)) && (wabs < Math.ceil(warray))){ break; } else{ warray = 1; break; } } for (var yi=0; yi<myArray.length; yi++) { var yarray = myArray[yi]; var yabs = Math.abs((yarray*z2)) if (!(yabs > Math.floor(yarray)) && (yabs < Math.ceil(yarray))){ break; } else{ yarray = 1; break; } } I have two options (I don't know which one is easier because I am clueless about loops) Option 1: Basically I want to find warray, and I want to find yarray, and then once I have found them, I want to check if they multiply to be x If they don't, try again and eliminate the option. In other words: I need to try every combination of numbers in the array until I find two numbers that aren't decimals when they are multiplied by "z1" or "z2" and they both multiply to be "n" Option 2: Find a number for warray that isn't a decimal. Set yarray = (a/warray). If that number * z2 isn't an integer, find warray again, but eliminate the option that didn't work. Thank you so much! Hey, how do I make the following accessible if JS is disabled? Code: <select onchange="if (this.selectedIndex > 0) location.href=this[this.selectedIndex].value;"> <option value="www.domain.com">Your Domain</option> </select> Hi all,i'm wondering how to detect select option changes.For example i want the data in database changed when i click on update button and if there are changes on the select option side.If the values on the select option are not changed,i can't update the data..Is there a way to achieve it?Thanks a lot...
I have some code for a dropdown where when the 'Other' option is selected a textbox appears and the user can put in their info. What I'm wondering is, how can i set it up so if the Other option isn't selected the dropdown info is sent to my database Name field, and if the Other option is selected it sends the info that's typed in to the Name field in my database and does nothing with the actual 'Other' label in the dropdown? here's the code i have so far Code: <script language="JavaScript" type="text/javascript"> <!-- function getOther(sel,fld){ fld.style.display = (sel.selectedIndex==sel.options.length-1)?"inline":"none"; } //--> </script> <select name="Name" id="Name" onchange="getOther(this,this.form.oth);"> <option>Name 1 <option>Name 2 <option>Name 3 <option>Name 4 <option>Name 5 <option>Other </select> <br><input type="text" name="Other" style="display: none;"> Hi, I have a select box whose options are populated from an xml file, the code goes like this: Code: var sel_html = '<select onChange="handleSelected(this)">' + '<option selected> - Select a zone - <\/option>'; var a = 0; function createPolygon(pts,colour,name) { var shape = new GPolygon(pts,"#000000",1,1,colour,0.5, {title:name}); gpolygons[a] = shape; // ======= Add the entry to the select box ===== sel_html += '<option> ' + name + '<\/option>'; // ========================================================== a++; return shape; } // ======= This function handles selections from the select box ==== // === If the dummy entry is selected, the info window is closed == function handleSelected(opt) { for (var a=0; a<gpolygons.length; a++) { gpolygons[a].hide(); } var a = opt.selectedIndex - 1; if (a > -1) { gpolygons[a].show() } } sel_html += '<\/select>'; document.getElementById("selection").innerHTML = sel_html; which works fine for showing one option at a time, but what I would like to do is have one of the selections to be to show all of the options at the same time. At the moment I have it working with a checkbox that works off a separate piece of code, but it would be great to have that option within the select box. You can see the select box in question here - it's the one on the right which says "Select a zone" thanks in advance. I have a select box with a few options. When the page loads I need to get the selected option in this select box and alert its inner text. Yet everything I try out on the net that should work wont work in IE, all other browser its fine. Please can someone show me the TRUE and correct way to get the inner text of a option from a select box in IE? Thanks! |