Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 306
  • Last Modified:

OnChange of Dropdown - Write value of adjacent column to page

Help!
Upon making a selection from a dropdown menu, which selects a value from a table in a recordset....I want to write the value (say, in a text box in form) contained in another column in the selected record.  

Using javascript/ASP

Columns in recordset are:

ID | Model | Color

code for dropdown:
<select name="Model" class="textboxes" id="select" title="<%=(rsModels.Fields.Item("Model").Value)%>">

I think I should be able to insert an onChange event handler inside this select tag and write (to a text box)
where the value of "Color" that corresponds to this "Model" but can't get syntax right.

Any suggestions?
Thanks much!  
0
lllcooljon
Asked:
lllcooljon
1 Solution
 
WakieCommented:
Perhaps something like this?

<SCRIPT LANGUAGE="JavaScript">
    <!--
    function dropChange() {
         document.formName.band_name1.value = document.formName.dropDown.value;
         return;
    }
    //-->
</SCRIPT>

<form action="script.asp" method="post" name="formName">
    <input type="text" size="30" name="band_name1">
    <select name="dropDown" onChange="dropChange()">
         <option value="band1">band1</option>
         <option value="band2">band2</option>
         <option value="band3">band3</option>
         <option value="band4">band4</option>
    </select>
</form>

REF: http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20495929.html

Regards,
Wakie.
0
 
gladxmlCommented:
lllcooljon,

Try to check out the link... might help...

http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20443483.html

HAppy programming...
0
 
CleanupPingCommented:
lllcooljon:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
GaryCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Answer by Wakie

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
EE Cleanup Volunteer
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now