473,378 Members | 1,507 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Question related to onchange function

Hi,
I am facing some problem with this onchange function with dropdown menu.
my task is:
i have one column in a table with dropdown menus. so all the cells of that column have dropdown menus. when the page is loaded these dropdown have some predefined values (suppose, there are 5 rows in the table and the values of the cells of that column is 1, 4,2,6,5). when i change any value of any dropdown menu then, an onchange() function is invoked. i want an array in the onchange() to have the list of the new_values of that column(suppose i change 6 to 3, then that array should hold, 1,4,2,3,5 instead of
1,4,2,6,5).
how do i do this.

Any help is appreciated.

Thank You!
Jul 11 '07 #1
1 1198
gits
5,390 Expert Mod 4TB
hi ...

let me give you an idea to achieve your goal ...

for easy access of your array-elements try to use an object (assoc. array) instead:

Expand|Select|Wrap|Line Numbers
  1. var hash_map = {'1': 1, '2': 1, '3': 1};
with that you may do the following things (assuming list_value is your selected value):

Expand|Select|Wrap|Line Numbers
  1. // delete an element of the map
  2. delete hash_map[old_list_value];
  3.  
  4. // put new value in the map
  5. hash_map[list_value] = 1;
  6.  
  7. // ask for a value in the map
  8. if (list_value in hash_map) {
  9.     // do something
  10. }
  11.  
  12. // or ask another way
  13. if (typeof hash_map[list_value] != 'undefined') {
  14.     // do something
  15. }
  16.  
try something with that ... and in case you have more questions, post your approach and we may help you with further details ...

kind regards
Jul 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Calan | last post by:
Mike, Your code on the dynamic input checking was excellent and very well explained. (The only thing I had to do was change the test for text input to be "1 > len of text", instead or "0 >...
6
by: Bonge Boo! | last post by:
This has got to be obvious, but I can't make it work. I have a form called with 3 pull down menus. They are linked to a database which generates the values for the <SELECT? Pull-downs. Lets...
9
by: beguigne | last post by:
Below is a snippet of a crude date picking routine for a form. I am a novice at this so, I am hitting my head at why when I select the day, the onChange event gives me a blank. What am I missing?...
8
by: George | last post by:
I need help with the code listed below. See the line below the comment-// *** This displays the error *** I want to be able to have the event handler call the function based on the reference...
2
by: joltman | last post by:
OK, this is kind of hard to explain, so I'll do my best: I have a form where I have a row where there could be multiple entries, so I have a link where it will dynamically add another row like it,...
2
by: Sally B. | last post by:
Hi, I have a main page that opens a pop up window when the user clicks a link. The pop up window is a menu and when the user clicks the item, it populates a form input element on the 'parent'...
0
by: swatikumari | last post by:
Hi,iright now i am facing one problem i.e... in my asp page i have two combo on selection of first combo it is going filter data in second combo which is pick form database.my problem is that when...
21
by: Leena P | last post by:
i want to basically take some information for the product and let the user enter the the material required to make this product 1.first page test.php which takes product code and displays...
8
by: sheldonlg | last post by:
I am still improving my AJAX and I ran into something that I'm not sure how to do. I will have a page called where I will have a dropdown list at the top and a large display at the bottom. The...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.