Hoping someone could solve this small problem of mine. I have numerous regions on a page that can be hidden/shown, the problem is i get a 'Line 8 Character 30 'id' is not defined' javascript browser error, but it works!
here is the code the error appears in:
PHP Code:
<script language="javascript" type="text/javascript">
/* This goes in the head section */
window.onload = function() { document.getElementById(id).style.display = 'none' }
function toggle(link, id) {
var div = document.getElementById(id);
if (div.style.display == 'none') {
div.style.display = 'block'
link.innerHTML = 'Hide Forms'
} else {
div.style.display = 'none'
link.innerHTML = 'Show Forms'
}
}
</script>
I have a PHP form, with a Customer Select List. Once an option has been selected, the 'custid', is passed to Javascript that collects all the contacts linked to that customer and populates another Select List. This works fine, but what I'm after is an extra two inputs to appear when a particular customer is selected, but I'm not entirely sure how to go about it.
Here it goes: Table/Form: Code: <script type="text/javascript"> var ajax = new Array(); function getTextList(sel) { var Customer = sel.options[sel.selectedIndex].value; document.getElementById('text').options.length = 0; if(Customer.length>0){ var index = ajax.length; ajax[index] = new sack(); .....
I am trying to hide/show table when hide/show button is pressed
Problem: The code works fine when I remove 'slow' from line 10. But with 'slow' in line 10 content of toggleButton doesnt change from Hide to Show when pressed.
I always want "smenu3" to show with "smenu4" and "smenu5" collapsed... When the user clicks the link, it calls a javascript function to show "smenu4" like so...
I have a project dilemma that is beyond my capabilities.I'm building a web based scoring system. I will input players names and their individual scores. Each of their 12 "station" scores will be placed into 12 text boxes and the total will be added up and placed into a textbox called Score.I've started with only two textboxes to start out and here is what I have (which works).
I have region which initially needs to be fixed in a certain position. After data is returned to the page and the user scrolls down to the bottom instead of remaining in its fixed postion I want my region to float to the top of the page, if I scroll right back to the top I want the region to revert to its original position.I found a very handy demo that did what I want ( http://fiddle.jshell.net/zsJAr/show/light/) BUT it uses JQuery and I am unable to use JQuery in my pages. Does anyone know how I can replicate what this demo was but without JQuery?
p.s. we are using script.aculo.os and prototype but I can't seem to find anything similar.
Basically I'm looking for a method where the user enters their postcode (UK only) clicks enter then they're displayed with their closest region (although not every single UK region will be displayed, only 6 of them). I know this is a fairly tricky one.I've had a look in to Google API though there's nothing really specific for this, does anyone have an idea? or point me in the right direction to achieve this?
I am trying to hide some form elements in a form by default and show/hide depending on which radio button is clicked. This is what I have but it is not working: Code:
I'd like to have a show/hide widget on my web site, kind of like "show details" / "hide details" in Google Groups. Is there a tutorial explaining how to make them? Google's is a bit complex and it's easy to get something wrong. If the browser does not support the required features, I want it to generate a completely static page with the "details" shown automatically.
i have 5 sections in seperate divs and i am trying to collapse them using anchor onclicks and some js to toggle the display style. I am a little unsure of how to make this piece of code work a little more elegantly(lack of js symantic knowledge). Code:
I have 5 links and 5 divs. When the page loads I've set the visibility of first div to visible and all the rest are hidden. When the user clicks on second link I want to hide all the other divs and show only second. Similarly when the user clicks third link I want to show third div only. You get the idea. Here is what I have so far. Nothing happens when I click the second link.
Basically, I need a link that gives the user an option to show the rest of an article, and then a link UNDER the rest of the article to hide a post again. The link needs to work uniquely with each link. Every method I've used so far has worked for one post, and on the next post, when the link is clicked, it just shows the rest of the first post.
I have a javascript that works great in every browser except IE8. In IE8 the rows of links change but this ONLY happens when you open and close the info using the same link.
I need to open a window without scrollbars, menus, etc. and a specific size. I believe I have found scripts that can do this. But I also need it to open to specific coordinates of the page. i.e, only displaying the center portion of the page (the page is not mine) and not letting the user move to other portions with scroll bars, nor resize the window.I realiize that hitting tab will usually move them around, but I am not worried about that. They won't know where they are and will just reload.I have basic html skills but not scripting, other than copying/pasting other people's code.
I am new on forum and javascript. I have got a query for dynamic geo location javascript. I would like to make a page which redirect to another page based on user REGION. Ex: If user from EMEA then page1.html, if user from APAC then page2.html, if user from Other region then page3.html
I would like to add some javascript to show/hide a certain row of a table. The first row of the table contain the hyperlink that calls the javascript the second row is the one i want to show/hide with the javascript in a toggle fashion.
the problem is a know very little javascript and have become incredibly frustrated because i went ahead thinking it was going to be like C. its not.
I know i can use these lines to do the actual work:
but I don't think i can use a getElementById exactly because i want to reference the element via its relationship to the hyperlink that calls the javascript, i know this can be done. You see there will be several tables on one page and i want to be able to toggle each one independently; hopefully with the same bit of javascript.
I have a working Show / Hide form, that works on FF, but what I would like to do is to be able to display one part when a user clicks on one radio button and display another part when the user clicks on the second radio button - here is the code which just shows / hides the whole form:
The idea is that the blue help text rechtangle will have to remain visible when mouse over (because there will be soon links in it) and invisible when onmouseout.
I have now placed javascript on the small numbered balls and within the rechtangle itself.
But I have it in a way that when "onmouseout" the blue help rechtangle will be hidden. But now the onmouseout event is acting like onmouseover. Any Ideas to do this correctly? So right now when you onmouseover it it will disappear :S
If I get this working I can start thinking of putting a timeout on the rechtangle for it to disappear within a couple of seconds after "onmouseout"
I'm using a simple show function, called from a button.
function show(rowId) { var hideRow = "View_" + rowId document.getElementById(showRow).style.display ="block"; }
QUESTION: I'm using xsl and can have more than one table row with the specific rowId, and I want ALL of them to show when the button is clicked for that rowId. But although the html source is there, I only get the first row with the rowId.
I have some divs laid on top of each other. By clicking somewehre specific I want to hide all the divs but except for one - which is related to the point i clicked - to show up.Here is my code so far:The function will be called by something like this:
All these divs are in the same from the right_nav-class.I guess the problem lies within line 6, where I want to select the div that should show up and is given as the argument of the function.The commented lines are things I already tried, but didn't work either, especially $(this).style seems to be invalid.It does hide all divs as i want, but the one i want to show again doesn't show up. It just stays hidden...
I got this example code which show rows when click on it, the problem is it shows all but I want if I click on one row it shows that one and hide others.