Forums

Double Dropdown stopped working

tshirley 06 Nov, 2014
Hello again,

A very strange situation.

I have a V5 form with two simple double dropdowns, each Event with set options to nother dropdown.

This was working when I created it yesterday, but has now stopped working even though I have not changed the dropdown fields.

The behaviour is that dropdown1 is not populating the options for dropdown2 even though the event is correctly set up. There is a second pair of dropdowns with similar behaviour. As I said, these worked when I created them 24 hours ago.

What I did do this morning was to add a couple of events and actions in Setup, including a Javascript Load event, but after playing with that for a while I discovered a simpler solution and so deleted them. This the only change, but is it possible that there is something residual left there that is causing the dropdowns to not work?

I set up a clean form and the dropdowns I added (with the same settings and data) work perfectly.

Please don't tell me I have to start this form again, it was a lot of work to get it this far...😟
GreyHead 06 Nov, 2014
Hi Tim,

This sounds like a JavaScript error on the page - do you see anything in the JavaScript console?

Bob
tshirley 06 Nov, 2014
Um...

Sorry, not sure what "Javascript Console" is.. where do I find it?
tshirley 06 Nov, 2014
OK... found it...

Here is the error.

Uncaught SyntaxError: Unexpected token ILLEGAL

No indication of what it relates to.

Cheers

Tim
Max_admin 06 Nov, 2014
Please try to clear your browser cache and website cache, also does the error point to a specific line of code, you can usually click the error and that would send you to the line with the problem, it also notes the file name.
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
tshirley 06 Nov, 2014
OK.. there was a line number across to the right, when clicked it gave:
$("[name='Club_Nbr']").on("change", function(){
if($("[name='Club_Nbr']").val() == "M-15426"){
$("#cfi_email").find("option").remove();$("#cfi_email").append('<option value="somename@xxzz.org.au">somename@zzxx.org.au</option>');
$("#cfi_email").append('<option value="
"></option>');    ******************************************************************************the error on this line.
$("#cfi_email").append('<option value=""></option>');
GreyHead 06 Nov, 2014
Hi Tim,

Looks like there may be a carriage return in this line that doesn't belong there
$("#cfi_email").append('<option value="
"></option>'); 

Bob
Max_admin 06 Nov, 2014
Hi Tim,

How do you have the dropdown loading the results ? using AJAX ? if yes then please make sure that no empty lines are returned as Bob noted!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
tshirley 06 Nov, 2014
Hi,

This is not using AJAX. It is a simple pair of dropdowns using the events and Static Options in the dropdown field, straight out of the box and just as the FAQ http://www.chronoengine.com/faqs/70-cfv5/5232-how-do-i-build-a-dynamic-drop-down-in-cfv5.html suggests in its first option.

I noted in my first post above this worked at first - and works fine in other forms. But after I added (and then deleted) a couple of other Actions including a Load JavaScript Action.

I have since tried adding a completely new pair of dropdowns in this form with the same result.

I guess I can always start again. Thanks for your patience with me.

Cheers

Tim
tshirley 07 Nov, 2014
I have managed to clear the problem by deleting all the relevant dropdowns and saving the form, then adding them back in.

Not sure what happened; but it is clear now and thanks for your help.
Max_admin 08 Nov, 2014
Answer
Hi Tim,

Good news, I think the problem was that you had an extra empty line in your options list then!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
tshirley 08 Nov, 2014
Yes, that is probably the case.

This particular options list is about 25 entries, but not volatile; If it was more, or often changing I would have tried to figure out the dynamic options process and place them in a table. But I was taking the "easy" way out.

Many thanks as always for your help.

Tim
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger