The following code works for Radio buttons. If I select 'No', the text field 'no1' is displayed. However, I'd like to set it up so if they select 'Permanent' in the dropdown then the 'no1' is displayed.
<SCRIPT LANGUAGE="JavaScript"> <!-- function JumpToIt(list) { var newPage = list.options[list.selectedIndex].value if (newPage != "None") { location.href=newPage } } //--> </SCRIPT>
Which in turn selects an option from the original dropdown.
Works fine except.....
The options in the select call scripts that open new browser windows, and when this occurs popup blockers swing into action and block the new window. When I originally had the javascript calls as plain links such as [HREF="javascript:onCreatePrintable()"] the popup was not blocked since it was obvious that user was clicking the link. Now that I'm trying to save much needed space by putting these links into a dropdown, the popup blockers are not recognizing the user selection.... I guess. I was thinking the javascript could somehow simulate an onClick to alleviate the problem. Any suggestions?
I have a problem to solve where I have a Hidden set of 40 text inputs. A link to show 10 more of these in inputs at a time, all having unique ID's. The goal I am trying to accomplish is to set the focus to say the 10th input. If the "show more inputs" link is clicked then the focus should go to the next 10th input (really input ID number 20) and so on.
I wanted to create a small DHTML code that created a unordered list of input forms dependent on the number selected from the select dropdown menu. Problem is that it doesn't seem to want to generate the list. I think the variables are within the scope of the function too, and I didn't get an errors from the javascript console when using firebug. The script itself runs, I tested it when I used the old standby alert(); to see if the script was active. Here's the code:
I am trying to use the Jquery selecmenu to skin dropdowns.There are extra UL LI getting formed with data "undefined" so dropdown is showing undefined in end.
I've got some PHP and javascript working together to create a marginless image popup from another arbitrary image. This works perfectly in Firefox, but IE bombs and I'm not really knowledgable about Javascript to be able to tell immediately why. Here's the relevant code from the page:
<a href="#" onClick="window.open('http://www.somesite.com/popup.php?image=popup.jpg', 'popup', 'width=737,height=492, directories=no, location=no, menubar=no, scrollbars=no, status=no, toolbar=no, resizable=no, top=300, left=300'); return false" style="cursor:pointer"><img src="http://www.somesite.com/pics/thumb.jpg" alt="Click here to see a larger image"></a>
have the follow jwplayer i've got a link that loads the video into the player fine but now i am trying to add another one that load with the hd optionhere the single one works fine
I have a page where an alternate address area is kept hidden via JavaScript and CSS divs. If you click that you want to use an alternate billing address, two divs are expanded. One with the form fields for entering in your alternate address, the other area has further info about why we need that alternate address. (Code is below). This works PERFECTLY for my needs....however, if you reload the page, the "show" button remains selected and OFF=ON and ON=OFF if you get my meaning...so when you click the radio that should be hiding the divs, it shows them and vice versa. Additionally if there is an error in the form and the page reloads to display the error, only the billing address area stays expanded (its inside the <form> tags), the text area next to it goes back to being hidden, and the show/hide OnClick no longer works. Ideally, I'd like the two to maintain the same state (i.e. if both we're shown, both stay shown).
CODE (trimmed down of course): Code: <head> <style type="text/css" media="all"> .invis { visibility: hidden; display: none; } .vis { visibility: visible; display: inline; } </style> <script language="javascript" type="text/javascript"> var c = 'invis'; var ids = new Array('id1', 'id2'); // IDs of your <div>s function doSwap() { c == 'vis' ? c = 'invis' : c = 'vis'; for (var i=0; i<ids.length; i++) { document.getElementById(ids[i]).className = c; }} </script> </head> <body>
<div id="id1" class="invis">This is all just plain text that appears when the NO radio is clicked but disappears on reload</div> <form> <table> <tr> <td> <input type="Radio" name=" " value="hide" onClick="doSwap()" id=""> YES <input type="Radio" name=" " value="show" onClick="doSwap()" id=""> NO </td> </tr> <tr id="id2" class="invis"> <td>extra address entry stuff that appears when the NO radio and that stays on page after reload</td> </tr> </table> </body>
I'm having problems with a Javascript 'Lookup' function.
Basically, I have a select menu 'Customer' which triggers a 3 JS functions, to populate 2 extra select menus.
Using IE Developer Tools, during debugging, I get this error: Expected ';' Error
This relates to either: eval(ajax_CustContact[index].response); OR eval(ajax_CostCentreContact[index].response); (it's a bit random, as sometimes it works, sometimes it doesn't)
I have tried changing the 'custid' to 'custname' to check whether it was an integer causing the problem, but had the same problem.
We have a list of items that each has a different quantity available. So I am going to create a multiple select menu, where they can select several different items. So, how can I make it that when they leave the field it sends all the different ones to the ajax program to build all the appropriate quantity forms?
The below code works, until i try and move the bottom button into the form. I'm pretty sure it has something to do with the tut3 function and I probably need to reference the form somewhere in the function, but I dont know where.
Code:
<script language="javascript"> var properties = [<? echo $row['property_id'] ?>]; function tut3(){ var addRemove = document.getElementById('addRemoveProperty');
I've spend about 2 days writing this javascript code and it works great in IE only to find out that it does nothing in Safari/FF.
Here is my code:
<script type="text/javascript">function calculate() { var thetotal = 0; var silver = 0; var gold = 0;
[Code]....
Basicly what the script does is using some variables in my form will calculate a total price in real time when you click the "Calculate" button. Works great in IE, but in Firefox/Safari it won't do a thing..
Hey all, I'm using a fairly simple accordion script. When I went to take a gander at the page in IE I found that the onclick function of the script doesn't respond. It works in FF, Safari, Chrome and Compatibility Mode in IE 8
the error message IE gives me is
Message: 'h' is null or not an object Line: 13 Char: 77 Code: 0 URI: http://proposalfor.us/js/script.js
I have a simple problem that I can't solve. I am trying to code a "More Info" button/link to display some more technical details of an item, if required or wanted. I haven't tried incorporating any code in to my web site yet, first I am trying to test how it can be done in a seperate file.
What I have right now is a table with two cells. In one cell is static text, in the other is a hyperlink. The onClick event calls a JS function called "more_info()" in which a global varible is altered to contain the value 1.
Directly after these two cells is more JS (this is before the table ends). The JS here is checking to see whether the value of the global variable has been changed. If the value is 1, display information. There is no "else" clause because I don't want information displayed unless the variable is equal to 1, so it is not required.
I think I know what the problem might be. The browser is reading the code in question before I ever click the link and has already been executed before the variable is changed. I know JS is object oriented so it will not sit there waiting for me to click the button before reading the logical statements.
I have a web page a lot of thumbnail images arranged in a table. I would like the user to be able to click on the thumbnail to open a window with a larger view of the image.
So I wrote a JS function to accept a URL as the argument and open a new pop-up window with the given parameters. I need this function to potentially run multiple times from multiple links (in this case images) on the same page. However, after the first time I click the link, the function runs, and I close the pop-up, the function will not run again if I click the same or another link on the page. If I refresh the page, the function will work once and then not again. Is there a buffer I need to clear or something to reset to allow multiple links to work?
I have tried the function call in a whole slew of ways. Here's my current code (I "..."'ed out the URLs for brevity):
The first checkbox should spawn a menu and then the "breast" option could spawn another. It works flawless in IE9. But in FF 3.6 the first checkbox simply does nothing. In Chrome, it spawns the menu, but strangely the checkboxes in the next menu are not clickable.
I have created a site with menu, it is working fine locally but when i upload it on the server it dosen't work. When I click on submenu under "Company" or "Products",It will show the actual url in the address bar but it gives a error "405 - resource not allowed". Kindly check and let me know the solution for this. If you know any other simple script similar to this let me know.
I'm pretty new at this - been using JQuery about three weeks full-time with good success. But. Some of the elements in my HTML can be selected by their ID's, using the $("#some-id") syntax, and some can't (the selector returns an empty set). In the debugger (Visual Studio) at a break point in the Javascript, I copy the ID value directly out of the html into theimmediate window and run something like to print out the length property of the wrapped set: ?$("#unfindable").length and get zero. I can do the same thing on other ID's and JQuery finds them as I would expect, and Ican't see the difference between the ones that JQuery findsand the ones it doesn't: for instance, they might both be divs. These aren't form input fields - for those I use something like $(":input[id='some-id']") and it works consistently. I don't do anything fancy like changing ID's at runtime - this is all simple static HTML, so I know that the element is there in the DOM and that it has the ID I'm looking for.