I know very little javascript, I am more familiar with php. I am working with javascript code, php/mysql backend and smarty templates. I am trying to get the textfield box to update with a variable from the database based on the selection from the drop down field. My dynamic drop down selection works fine, it is pulling the data from the database (example:$item[i].PARTS_RATE_ID}) just fine. But I want the textfield ('parts_price['+iteration+']') to dynamically show the $item[i].PARTS_RATE_COST from the database (in the parts section), associated with the $item array from the "parts description".
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.
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'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:
I'm a newbie. I have just working with jQuery for 2 hours. For example I have a drop down list like this:
<select> <option>Fruit</option> <option>Color</option> </select> If I select Fruit, another drop down list appers and give me some selections: <select>
If i have a drop down list on my website, and i want to use javascript to change its selected value,however, i do not have the id/name attribute of the option i want to select, only have the "value" attribute of the option, can it be done?
I have noticed a few requests lately on the forum where there is a request for a dynamic dropdown list (<select...> tag) that would display one set of options if one condition is met, but a different set of options if a different condition is chosen. This is my attempt to solve this problem for other users. The following code is a template to show one way of how this question could be resolved.
The intention is that when you select a site from the list, the banner underneath changes. However, I can only get it to do this once, then it simply refuses to let you select anything else. This is the code I am using to change it:
function defineimage() { if (document.forms[0].gourl.value = "http://jeff.zhomg.com") { document.images.linkimage.src = '/images/exchange/jeff.gif' } else if (document.forms[0].gourl.value = "http://www.strangedrawingsartgallery.com") { [Code]...
I'm a complete rooking at javascript (and haven't looked at php in months), but am wondering if its possible to do the following with javascript. I have a listing of 10 to 16 teams. I'd like to be able to list the teams in a drop down select box. And when the user selects a team, that teams listing of players is than shown below. The user should than be able to toggle through the listing to review each time.
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.
OnChange, I want to invoke a function that auto populates the rest of the SELECT fields in the form. The select boxes will vary in quantity as the page is dynamic, but the values are always the same (like the code above).
i have written the following code in order to fill a drop-down menu with the "alt" property of images. My problem is that i want my menu be able to hold the old values. Now the new values replaces old.
What I'm trying to achieve is that when I select the "other..." value, that �field? change �onchange? to a text field in order to let the user to input his custom color manually.This is the classic list/menu:
I'm using PHP / MySQL / javascript (very new to javascript)I'm looking to set the value of a textfield based on the name (NOT value) of a drop-down. The drop-down is created dynamically from a recordset (see code below):
<select name="mainStory" id="mainStory"> <?php do { ?>[code].....
I have 2 dropdown lists which are connected to a mysql database. When I select an item from the first dropdown list the second dropdown list should show item which are linked to the item from the first list. But the thing is I can select an item from the first one, but the second isn't showing anything.
In the mysql database I have 2 tables: hesk_programma and hesk_projecten. In table hesk_programma there are a ProgrammaID and Programma column. In table hesk_projecten there are a ProgrammaID, a ProjectNumber and a Project column.
ProgrammaID from the two tables are connected to each other, so when I select an item from the first dropdown list with the ProgrammaID AK, the second dropdownlist should only display the items with the ProgammaID AK from the hesk_projecten.
By the way, one more thing. The ProjectNumber from the hesk_projecten table should be displayed (when selecting an item in the second dropdownlist) in a input text field.
I am new to JavaScript and would really appreciate any help to solve my problem.
I am using the blow code in my form to validate form fields. What I would like to accomplish is that if when the list/menu (attribute6) value is "Ja" then to make the TextField Pas Nr (attribute4) required. And if when the list/menu (attribute6) value is "Nee" to make the TextField Pas Nr (attribute4) not required.
I have tried to adjust the code with no success. I give up and hope that someone can help me to the right direction! ....
The problem is...when I type in search textfield it focus in the name list..like for example i type a after I press a it was focus in the firstname, which is wrong..I think it cause from the javascript code..I want to happen is i continue typing in search textfield.
I have a PHP form which has an select field (i.e. drop-options) where the different options are populated from a MySQL database as follows:
<select size="1" id="category" name="category"> <option value="">Select from drop-list:</option> <?php $sql = "SELECT * FROM `DB1`
[code]....
Now, the issue I have is that I also have another input field (possibly hidden) in this form which is called 'category_id', and what I want it to do is to automatically populate when the user selects the relevant 'category' from the select field above.