I have two selectboxes. I just want it something like this, when I select a value in my first selectbox the second selectbox will show. And when I select different value on my first selectbox, my second selectbox will hide. Meaning, there is one value in my first selectbox that has the ability to show the second selectbox.
My code (below) works if I place the selectBoxes in different cells on a table. However, what I want is only ONE selectbox displayed at a time, not the 3 different select boxes in 3 different table cells of the table.
I initially want the citySelect to display, but if user clicks option [-- change country --], then the citySelect is REPLACED by the countrySelect. Then, on making a country selection, the countrySelect is REPLACED by a new citySelect which is populated with the new city list.
Code: <script type="text/javascript"> <!-- function loadCities(countryID){ if(countryID == "") {
how to do what i wanted. I've got a .pdf file with a bunch of text fields, i would like it to make it so that when the user has focus (is writing in or clicked it) on of the fields it shows a different field with information on how to fill out that field and which field to procede to. Ive figured out how to show a field when focus is on another field, but cant get it to hide again when focus goes to something else.
I'm currently working on a project which is essentially a clickable world map. I have successfully mapped the image and using a OnMouseOver = "Continent()" OnMouseOut = "World()" command in each mapping line ie. <area shape="poly" onmouseover="NA()" onmouseout="World()" coords="(lotsonumbers)".
In my continent functions I change the image using something like: function Africa() {document.images[35].src="/_View/images/maps/worldmaps/world.africa.jpg"; return true;}
This gives me the "highlighting" effect I was looking for when people mouse over the continent.
However! my problem now is that I need to find a way to essentially link that with a cell within the same table as the mapped image. There is a list of the continents in the column next to the map (the map has all the rows merged in that column). I need it so that if I run the mouse over the continent or that cell both of them highlight at the same time. I see the best way of doing this as having both call the World or Continent function. However I have been unable to find any way of setting a specific cell's background or text from within a function.
I'm inexperienced with Javascript and I found this script, but I'm not sure how to alter it to do what I want. I have a PHP script that creates forms in a loop. $z in this case could equal 3, and 3 forms each containing 1 Position/Office field will be created including 1 Candidate field. If a user wants to add a new candidate for that specific position, I want to be able to add a Candidate text field just relevant to that Office/Position. With this script, I've only been able to pop up a text field under one Office/Position and not under any other Office/Position. I think it has something to do with my divs.
Javascript:
var inival=0; // Initialise starting element number // Call this function to add textbox function addTextBox() {
I need to find all rows in a table ending with an id.. $("element[id$='txtTitle']")
this will work fine i know.... but i want to find it inside it inside another table whose id i have and not the whole document.. how do i achieve this??
I'm trying to grab a specific part of a string of text and am wondering how to do it (or if it is possible to do it) with a jQuery selector.Is there any way to get that specific part of the link?
I've managed to output the text of my two arrays to a specific div (in this case the div's id is ''number') - BUT I'm only seeing the last data from each array (it's a train number and a train name) so instead of getting the entire list from 800 to 870 and the associated names I'm just getting the last pairing which in his case is 870 Zulu.
<script type="text/javascript">
this is my code. Can anyone see where I'm going wrong? code...
HTML Code: some text [URL].. continue of the text How can I add some content before and after the matching statement. I meant for example how can I change the above text into: HTML Code: some text <a href="http://www.example.com">http://www.example.com</a> continue of the text
I wanted to know how can I check for a specific HTML tag or user defined TEXT and delete it when the page loads
Whenver the IE loads the page my company add its COMPANY NAME in my office on any page so what I want to do is to check for my company name b4 the page loads and remove the company name and then load the page.
What is happening is $(this) is no longer based on .expand being the (this) that is clicked.
like if i have a button SOMEWHERE randomly on the page with this
<div onclick="Minimize('_alerts');">Click Here</div> this will minimize alerts but because the (this) in minimize function doesn't actually point to the right button that I want to add a class to.
Is there a way to modify the minimize function so that it finds the <div id="mytoggle"><ul> <li class="expand boxminimize" rel="_alerts"> using the rel toggle, and then changes the class of the li from expand boxminimize to boxexpanded??
just like the .expand click function I posted on the top of the post that works?
Another thing that has been driving me crazy is that css positioning is handled differently by different browsers. JS is not my area, but I can do a lot with CSS, and I do, but cross browser compatibility is killing me.
I can use an IF IE statement and only IE runs that segment of code, but I haven't been able to figure out out how to make ONLY firefox or ONLY opera or safari enact an encapsulated segment of code. The same type of IF statement doesn't work for them.
Is there a single method using JS that works for all browsers?
we probably all know the problem that select boxes under IE are always overlap DIV layers. Afaik there are two workarounds:
1. hiding the select box 2. IFrame beneath the DIV layer
But I don't know how to do that.
We want to show a DIV layer as tooltip. The DIV layer has no defined size (neither a width nor a height attribute). The size depends on the text the user defined for the tooltip.
My questions:
1. How can I know when the tooltip is 'over' a select box, so I can hide it.
2. How can I define an IFrame that has the same size as the tooltip, when I don't know the tooltip's size?
Having a problem with validation, it's been a while since i have done some javascript but i'm pretty sure it used to work on both browsers but i can't get this to validate in FF.
function result(){ var result = document.getElementById('resss').innerHTML; }
But what I actually want is to import data from a table of an external website. E.g. I want to get the innerHTML of a specific cell in column 3 and row 2 of a specific site.
I have a long list of options in multiple selectbox. The selectbox gets a scrollbar in that situation.
Does anybody know if it is possible to scroll through the options with javascript? eg: moving the to the first selected option?? Any samplecode, API, pointers?
I have a select box whose options are populated from an xml file,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.