Dynamic Drop Down Causing Issue any ideas

Posted on 2011-05-01
Last Modified: 2012-05-11
Hi All,

I have a page that has a check box on it called porting once the page is submitted the page it calls

addline.cfm checks to see if the porting check box was checked
<cfif #form.PORT# eq "on">

Open in new window

on the second page (addline.cfm).  I have a dynamic select system.  Choose a item from a drop down and the values in the second select are displayed based on the values in the first.

in this case , select phone type (eg evo or iphone) and the second drop down then displays the colors available for the phone selected in the first.

I acomplish this by calling the this.form.submit when the user selects an item from the first drop down.
 <select name="select_Phone_Group" required="yes" onchange="this.form.submit()">

Open in new window

The issue I now have is that it calls itself and then cant find form.port as a defined varaible
Element PORT is undefined in FORM.

any ideas around this ?

Question by:PatrickMacC
    LVL 39

    Accepted Solution


    Since port is passed in from the first page, it exists the first time you go to the addline.cfm.  However, when addline.cfm's  form refreshes the Port is not a field on THAT form so you get an error.   All you need to do is add a hidden form field PORT on the addline.cfm form so that when it refreshes the value is passed again

    <input type="hidden" name="Port" value="#form.port#">

    Author Comment

    oops !.. so I forgot to mention that there is a loop so it only works for the first time.

    eg.  the first page asks for how many lines total are you working with #total-lines#
    it asks if some of those lines are ports yes or no #port#
    and then it asks if port is yes how many are ports of the total lines #port-lines#

    the Addline.cfm page then does the following:

    1) shows the dynamic drop downs for the port lines (asks for the number porting as well as what type of phone (drop down 1) and color of phone (drop down 2 generated from drop down 1)

    2)shows the dynamic drop downs for the non port lines, same as (1) without the question whats the number

    so while the solution above works if there was only one line, it wont work for 2 lines +

    anyother ideas.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Suggested Solutions

    Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
    JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
    Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
    The viewer will learn how to dynamically set the form action using jQuery.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now