Forums

'combo' box input

Vizinho 22 Jul, 2014
Hello!
I want to add a field for "Other" after a dropdown.

I carefully followed the FAQ: http://www.chronoengine.com/faqs/58-cfv4/cfv4-elements-and-html/2657-how-can-i-build-a-combo-box-input.html , created the dropdown and the text box with the same names but different ID's, created the Load JavaScript action on the OnLoad and used those id's to change the code.

When I view the form the other field is always enabled. It was supposed to be disabled and then enabled when 'other' was selected.

What am I missing?

Thank you.
GreyHead 23 Jul, 2014
1 Likes
Hi Vizinho,

The main thing that you are missing is that the FAQ was written for CFV4 with MooTools and you are using CFv5 probably with jQuery so everything has to be re-written . . . BUT there are some built in features in CFV5 for Event handling and they may well do what you need.

Each element has a 'Load State' so you can set it to start out Invisible and Disabled and DropDown elements (plus Checkboxes and Radio Buttons) have an Events Tab where you can add settings to Unhide another element when a specific value is selected.

Bob
Vizinho 23 Jul, 2014
Hmmm ok! Thanks.

... I tried to do as you mentioned. Set the textbox 'other' (ID: local_outro) to Disabled.
Created an event in the dropdown so that when the user chooses "Outro", 'local_outro' will be enabled.



What is happening is that the textbox gets Enabled when the users chooses "outro", or any other of the alternatives.

Where am I failing to understand this?
Vizinho 24 Jul, 2014
Ok!
I checked the demos and made it work!

Last problem: On the email the data entered on the checkbox or on the 'other' field does not appear.
What I must put in the email code? Not just the ID of the field?

Thank you for the support.
GreyHead 24 Jul, 2014
Hi Vizinho,

You need to put the name of the input as {input_name} into the email template.

Bob
Vizinho 24 Jul, 2014
Hi!

Well I have all the other fields in the email template working. I'm using the id inside the parentisis. I think that is what you refer with the input name.

When I do the same with this two fields it returns blank on the email.

Am I doing something wrong?

Thank you.
GreyHead 25 Jul, 2014
Hi Vizinho,

Please turn the Debugger on in the form and post a link to the form here so that I can take a look. (If the form is live than do this with a copy of the form.)

Bob
GreyHead 25 Jul, 2014
Hi Vizhino,

Thanks for the login. I found a couple of things, The input names were Local and Local_Outro but the email template had local and local_outro - they do need to be exactly the same including the capital letters.

I also deleted the ChronoForms cache from the icon in the toolbar - that seems to be needed if you change the columns in a database table.

Lastly, to tidy up a bit I moved the Custom Code and Email out of the Check Captcha On Success event into the main On Submit event.

Bob
Vizinho 25 Jul, 2014
Bob, Thanks!

I was assuming that I should use the ID not the Field Name. I had no problems before because they were exactly the same. This is one of those circumstances where the solution was right in front of me and I kept being blind... or silly!

Also appreciated the housekeeping!

Just to wrap up this post I have one doubts on the meaning of the 'On !=' in the events tab.
Adding the '!' makes it to mean "different"?

I have a last form to make, the most complex one. Lets see if I accomplish it without interrupting you too much.

All the Best!
GreyHead 25 Jul, 2014
1 Likes
Hi Vinzino,

The ! is 'not' so != is 'not equal to'

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