• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 304
  • Last Modified:

Dynamic Drop Down Causing Issue any ideas

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 ?

thanks
0
PatrickMacC
Asked:
PatrickMacC
1 Solution
 
gdemariaCommented:

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#">
0
 
PatrickMacCAuthor Commented:
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.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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