Updating The Drop-Down List On One Window From Another
Jul 23, 2005
I'm trying to alter the contents of a drop-down (select) list on the
parent window from a child window in IE 6. After opening the child
window, I set its opener to reference the parent like this:
childwin = window.open(...)
if (childwin == null)
childwin.opener = self;
Then, to update the parent select list from the child window, I do
this:
opener.document.myForm.NameOfSelect.options.length = 0;
opener.document.myForm.NameOfSelect.options[0] = new Option("", "");
for (var ixy = 1; ixy <= newDataArray.length; ixy++)
{
opener.document.myForm.NameOfSelect.options[ixy] = new
Option(someNewDisplayText, newValue);
}
This looks correct and works up to a point. I can empty the parent
select by setting the its options.length to zero. But, when I try to
add new options, IE gives me a "server threw an exception" message.
Is all this even possible in IE?
I want to implement a page which has a dropdown list of images in the directory such that when a user clicks on a new value from the drop down list, an image displayed in a <div> changes in sympathy with the user's selection ...
I am trying to create a drop down list which depend to the value selected from the previous drop down list. I can add it without problem, but If I change again the value of the first drop down list I would like to remove the previous drop down list generated from the first value. If I try to remove it when I create the element, it even does not create the element, the remove element function seems to work because when you click on the remove link it works.
I have a DB query that returns CustomerID, CustomerName, CustomerContact, CustomerSalesID. This Query populates a dropdown.
I need to have the Customer Contact applied to a text field and the customer Sales ID used to select the SalesRep from a different drop down when you select a customer.
Not too hard I'd think. I don't think I need to go as fancy as AJAX since I've already called the query when the page loads, that data is already there.
Basically I'm making an order form that updates the Total Text Box at the bottom of the page depending upon which selection is made from the drop down box in the form,
I have a table that has parts with multiple characteristics. Part Number, Height, Width, Capacity, Price, Etc. I would like to have a drop downs for all of these values, when a user selects one of these values it will filter the results into a list. Ex. user selects a part that has a Height of 6 and width of 10 it will only list those parts. As I said earlier, I have a script that will give me all the parts, however I am not able to make the onchange list parts with multiple values.
I have a page that displays a list of people playing in a tournament. I need to be able to generate a Leaderboard based on which players are manually selected by the admin. Next to each person there is a drop-down list. An admin can go in and select a "slot" that a player should be in on the leader board from 1 to 8, or leave it blank if none. What I need to figure out how to do is the following, when a change event happens on a drop-down list, and say the value 5 is selected, I need to check to make sure that 5 is not already selected in one of the other players drop-down lists, in other words, that the 5th leaderboard slot is not already full. if it is, display an error message and make them change that one first. how to do that with jQuery? I'm thinking it will have something to do with the each() function, but not sure exactly how the logic should work.
I'm just trying to find the best method of updating a running total of the value of list boxes. I basically have 6 items and I want a drop down box listing quantities. when a number is selected I want a total to update beneath. I'm not sure I can do this in PHP without reloading the page. Do i need to use Java script? if so I'm a total newbie can someone point me in the right direction?
I have been struggling on a bit of code for a while now. I need to populate a second drop down list (Region) based upon the selection of the first (County).I have found a piece of code that works on its own and have adapted to suit my needs - see below. However, when I drop it into my main page the javascript is not working. It's because of the formObject but I just don't know enough to resolve this! Furthermore, I need the textboxes the user has already completed in the form to retain their value once the javascript kicks in as the completed form will submit to a database.This piece of code is working well . . . .
<?php
$link = mysql_connect('myhost', 'myusername', 'mypassword') or die('Could not connect: ' . mysql_error()); mysql_select_db('mydatabase') or die('Could not select database');[code]......
I'm trying to set up a new window that contains a button. Then, if the user clicks the button, the window would display new information accordingly. I have written a simple test that won't seem to work:
<html> <head> <script language="Javascript" type="text/javascript"> var count = 0; function Window() {
i've a simple script that basically replaces the textnode attached to the title tag. and i thought since i'm updating the title tag the window title will automatically change. unfortunately it does not :(. what is wrong ?
function getText(txtMsg) { if ( document.createTextNode ) { return document.createTextNode(textMsg); } return false; } function setTitle(newTitle) { var title = document.getElementsByTagName("title"); if ( title[0] ) { title[0].replaceChild(getText(newTitle), title[0].firstChild); }}
i know for sure this can be done coz gmail does that...but still wondering how else ?? btw i checked if this was getting updated to to DOM properly and it did that too
I am created a site where personal messages will be sent to other members. To do this I want to allow users to either type in the users seperating their name by ; (ie Joe Bloggs; Michael Jackson; Fred Flintstone). or alternativly have a popup box where all the names on the database are displayed in a list with a check box next to the names. I will be using PHP to interact with the database and know about this
My problem is getting details from the popup box and displaying them in the text field on the main browsers form? So if in the popup box the user checked Michael Jackson's name how would I get Michael Jackson to dispaly in the main browers field (input name ="to")?
I've been beating my head against a wall for a few days trying to get this working. I'm trying to create a dynamic menu where a user selects one item and another select list is shown, then another and another (and so on). Here is my JS, it *should* be taking the ID of the div, comparing it to the selected value and then showing another div by settings it's class property to visible:
iam trying to use 5 drop downs in my form for user to select languages and each select drop down should not allow the user to select the same language again and all my drop downs are populating individually from the DB on the page so if "English" is selected for "dropdown 1" then again "drop down 2" should not allow "English" to be selected.
How can I create a Javascript drop down list File? I want to have a webpage that contain a dropdownlist. But i want the items and values of that drop down lists to be stored in a seperate javascript file, So that my webpage call that JS file whenever user click on the DDList.
Basically what i am interested in is to place all my drop down list Items manually in the javascripting file and then on the main page there will be links from alphabet A-Z so when the user click on alphabet A the dropdown list will only show the containing items start with alphabet A....
Hope this makes sense!! The reason why is because there is a long list of items and i dont want to put them inside my page.
I would like to use a control on a WebForm that acts like an editable DropDownList control. The user should be able to select a value from the list of choices, or type in a new value if no predefined choice is applicable.
It doesn't appear to me that a DropDownList control is editable.
How would you suggest I accomplish what I want to do?
I have what I think is a fairly simple problem, but I cannot figure this out. I have a SELECT object on my page. When the user performs a certain action, I want the focus to be placed in the drop-down field AND the actual list of drop-down objects to appear (i.e. simulating that the user has clicked in that field). Ideally, of course, the currently selected entry should be highlighted. Listed below is a snippet of sample code. If the focus is currently in the text field and the user clicks on the "Test" button, I would like the entire drop-down menu to appear. I have not had any success with the "fireEvent" method or the "click" method (only "focus" seems to work). Code:
The last two lines of the following code is not setting the value of the selector unless i debug it within firebug. when I set a breakpoint on those two lines it shows the val in the parentheses and it will set them correctly, but if I do not debug the script then it doesn't set them.
populateLists: function(executionLevel, contractor, program) { var _chart = this; $.each($('select#contractor option'), function() { if ($(this).val() != "all") {
Hello i use a javascript to use drop down lists so i display the appropriate products to user.Atm no matter the user option i display 3 drop down lists in whole products.Lets say the drop down lists are like manufacturer/order by/sochet.
When the user wish to see "processors" then the sochet list have values,but when he choose "printers" the sochet list is empty since the printers dont contan sochets.In this case i want to hide the sochet drop down list in order to be more familiar to the user is that possible?
My js looks like this
<script type="text/javascript"> function showUser() {
I have my link [url]. Basically I have two buttons one Add Single and one Add Double. When I press Add Single I want to have a new row with the single drop down list. On the other hand when I press the Add Double I want to have a new row with the two drop drop down list.
I know that this is very basic to most of you JS Guru's out there, but I am stumped. I have found dozens of tuts on this, but can't seem to find a VERY simple basic version of it. This is what I want, actually my client wants. I want to have a select list that gives the options of countries. Then upon selection this changes the drop down list of the states/provinces listed. So when I click on Europe it shows the different sections of Europe, and US it shows the states (I'm sorry I don't know what Europe calls their equivalent of a state), etc.
how to get the values from my drop down list and none of the methods that i have seen actually work with my code.I have read that it is possible only using javascript? but i have also seen people say that it doable with php? i have tried both methods and i still cannot get the values to be entered into my database(All of the other fields enter except the fields that i have to select using a drop down [code]