
December 13th, 2001, 05:01 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
Field disabling based on drop down list selection....
Originally posted by : ShiftyOk, for example's sake, let's say I'm creating a submission form where the user selects from a list of names in a drop down box, and then fills out information under that name. My drop down list is linked to a DB table consisting of the ID and 2 text fields (first name, last name). The droplist values are the personIDs, and it displays the lastname/first name in the field. What I would like to accomplish is that depending on what name the user chooses, certain fields will be disabled. Say I have 3 fields, (Title, Organization, Building). If the user selects a name with the last name "smith", then the building field will be disabled. The way I have it done now is that I call a javascript function in the event "onChange" that matches the current PersonID value selected by the drop list with those that correspond to the name "smith" in the table. However, the way I would like to implement it is the approach that I don't know what name corresponds to what ID ahead of time, so I need to be able to see what the current name is when I call the function to enable/disable fields. Basically, instead of comparing against the values of the drop list, is there a way to compare to the text it displays instead?
|