Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > ASP Pro Code Clinic
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 6th, 2004, 09:06 PM
Registered User
Join Date: Oct 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hawing Send a message via Yahoo to hawing
Default re:urgent.....asp and javascript problem..pls help

dear all,
i face a problem in asp where i hav 2 combo box and both combo i load the data from database.
When i choose the 1st combo, the 2nd combo will response to the value that i choose from 1st combo. in this case, i use javascript.
My code is like the below:-
HTML part:
<td style="width:35%">
<select style="width:100%" name="txtDesignationID" onchange="txtDesignationID_onchange(GetIndex(event .srcElement))">
<option value="">Select Designation First</option>
<%if TeamRS.RecordCount > 0 then TeamRS.MoveFirst
do while not TeamRS.EOF%>
<option value="<%=TeamRS("Code_Name")%>"><%Response.Write TeamRS("Code_Name")%></option>

Javascript part:
function txtDesignationID_OnChange()
    el = event.srcElement;

    if (document.frmasp.txtDesignationID.length > 1)
        for (var c=0;c<document.frmasp.txtDesignationID.length;c++) {
            if (el == document.frmasp.txtDesignationID[c]) {
                var Tmp = document.frmasp.txtDesignationID[c].options[document.frmasp.txtDesignationID[c].selectedIndex].value;
                if (Tmp != "") {
                    var url = "select_person.asp?txtDesignationID=" + Tmp + "&selected="+c;
                    window.open(url,'','toolbar=no location=no directories=no status=no menubar=no scrollbars=yes resizable=yes width=1 height=1 top=1 left=1');
    } catch (e) {

This coding work well in IE, how ever when i run it at Firefox (coz i use Machintos) it cannot work. The error it return to me is Javascript Type Error: Event has no properties.

Do anyone have any solution??


Old October 6th, 2004, 09:25 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post

Why not reload the page on selection of a value in the first combo, and pass the corresponding value as querystring, request the same on reload and use that to populate the second combo?

- Vijay G
Strive for Perfection

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with downloading with php..pls help urgent raaj Beginning PHP 1 November 9th, 2007 02:48 AM
Problem with javascript in asp.net appl-URGENT sunithavasudevan ASP.NET 1.0 and 1.1 Professional 1 October 24th, 2006 03:07 PM
URGENT - retrieve javascript variable into asp mussitsch Classic ASP Professional 3 June 15th, 2006 03:23 AM
Sendmail, Application - ASP.NET1.1-Urgent..Pls ! Abins ASP.NET 1.0 and 1.1 Basics 1 February 21st, 2006 08:06 AM
datagrid problem urgent pls. dsmportal Pro VB.NET 2002/2003 0 February 7th, 2005 09:00 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.