Combobox Condition

Issues related to forms.
User avatar
Pablo
 
Posts: 21708
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Combobox Condition

Post by Pablo »

Would you be able to suggest me an alternative solutions for now
The only alternative I can think of, is using events as described by WWBman
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Mon Sep 17, 2018 12:23 pm It works with Radio Buttons but not (currently) for Comboboxes.
E.g. http://www.mediafire.com/file/as7v9n29p ... s.wbs/file
@petejos, are you using Radio Buttons or Comboboxes?
I am using combo boxes. What would you recommend.
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

As Pablo says you can only have one action per choice in a Combobox, but in the next update (planned for later this year) you will be able to use multiple conditions with the same value.
Have you downloaded my test project? It uses Radio Buttons and seems to do what you want.
http://www.mediafire.com/file/as7v9n29p ... s.wbs/file
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Tue Sep 18, 2018 7:41 am As Pablo says you can only have one action per choice in a Combobox, but in the next update (planned for later this year) you will be able to use multiple conditions with the same value.
Have you downloaded my test project? It uses Radio Buttons and seems to do what you want.
http://www.mediafire.com/file/as7v9n29p ... s.wbs/file
Yeap, I downloaded your project. Thanks. I guess I just have to use that method for now. Thanks.
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

It's just occurred to me that when you click e.g. 2 after clicking 3 (and filling in 3) then although the editbox will be hidden the entry for 3 will still be sent in the email so I've added a bit of Javascript (in Page HTML) to clear the relevant boxes.
So I would download the project again to get the improved version.
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Tue Sep 18, 2018 9:03 am It's just occurred to me that when you click e.g. 2 after clicking 3 (and filling in 3) then although the editbox will be hidden the entry for 3 will still be sent in the email so I've added a bit of Javascript (in Page HTML) to clear the relevant boxes.
So I would download the project again to get the improved version.
I think I found a solution for now. I insert the editboxes in layout grids. Meaning if I need to have 5 choice, 1st layout grid will have 1 edit box, 2nd layout grid will be 2 edit boxes, etc. until 5 layout grids are created. Then then send the condition in combobox.

www.goec.com.au/goec2/page3.php

I tested and it work for me so far. Any comment?
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

Did you test the scenario I mentioned in my previous post?
I.e. the user fills in e.g. 5 boxes and then changes their mind and changes to e.g. 3 boxes.
Were boxes 4 and 5 excluded in the email?
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Wed Sep 19, 2018 8:36 am Did you test the scenario I mentioned in my previous post?
I.e. the user fills in e.g. 5 boxes and then changes their mind and changes to e.g. 3 boxes.
Were boxes 4 and 5 excluded in the email?
Not yet tested yours. However my desired design is still combo box.
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

petejos wrote: Wed Sep 19, 2018 8:52 am
WWBman wrote: Wed Sep 19, 2018 8:36 am Did you test the scenario I mentioned in my previous post?
I.e. the user fills in e.g. 5 boxes and then changes their mind and changes to e.g. 3 boxes.
Were boxes 4 and 5 excluded in the email?
Not yet tested yours. However my desired design is still combo box.
I didn't mean test mine. Did you test yours with the 5 boxes filled in then 3.
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Wed Sep 19, 2018 10:05 am
petejos wrote: Wed Sep 19, 2018 8:52 am
WWBman wrote: Wed Sep 19, 2018 8:36 am Did you test the scenario I mentioned in my previous post?
I.e. the user fills in e.g. 5 boxes and then changes their mind and changes to e.g. 3 boxes.
Were boxes 4 and 5 excluded in the email?
Not yet tested yours. However my desired design is still combo box.
I didn't mean test mine. Did you test yours with the 5 boxes filled in then 3.
Hi wwbman, you are right. They are not excluded in the email if they change the choices.
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

hi wwbman

How does this javascript works?
clearbox2();

The name of my editbox is "camper1name"
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

btw, I just tested and your javascript does not work. What went wrong? any idea?
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

My test version does work. What are you seeing that doesn't work?
You'll find the clearboxn(); routines in Page HTML under Before </body>.
They simply clear the relevant editbox.
Just replace my editbox names e.g. indexEditbox1 with yours e.g. camper1name
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Thu Sep 27, 2018 9:43 am My test version does work. What are you seeing that doesn't work?
You'll find the clearboxn(); routines in Page HTML under Before </body>.
They simply clear the relevant editbox.
Just replace my editbox names e.g. indexEditbox1 with yours e.g. camper1name
When i tried yr version, firstly i choose 3 then enter details then i chooee 1 and submit. The result i received are still 3.
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

In a previous post I mentioned this.
Did you download the new version?
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Thu Sep 27, 2018 11:52 am In a previous post I mentioned this.
Did you download the new version?
Yes I did.
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

Sorry but it works for me.
Can you share your .wbs file to see if I can spot any problem?
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Thu Sep 27, 2018 11:52 am In a previous post I mentioned this.
Did you download the new version?
My apology. I made some errors and now it is working.
btw, I need to unchecked a box when a different selection is made. For example, when a selection is made, i need one of the checked box in my form to be unchecked.
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

I think you can uncheck a box with e.g. nameofRadioButton.checked = false;
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Fri Sep 28, 2018 7:49 am I think you can uncheck a box with e.g. nameofRadioButton.checked = false;
That works. Thanks.

Can I also know how to reset a combobox please? Thanks.
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

Try:
document.getElementById('Combobox1').options.length = 0;
or just:
Combobox1.options.length = 0;
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Sun Sep 30, 2018 8:53 am Try:
document.getElementById('Combobox1').options.length = 0;
or just:
Combobox1.options.length = 0;
thanks. i tried, but it actually disable the combobox instead of reset to initial value/text
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

Try:
Combobox1.reset();
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Sun Sep 30, 2018 9:44 am Try:
Combobox1.reset();
Truly appreciated your quick respond. It still doesn't reset. :(
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

As you probably gathered I'm not a Javascript expert!!
If the user is selecting one item then try:
Combobox1.selectedIndex = 0;
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Sun Sep 30, 2018 10:07 am As you probably gathered I'm not a Javascript expert!!
If the user is selecting one item then try:
Combobox1.selectedIndex = 0;
bingo. it works. Thanks a lot.
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

petejos wrote: Tue Sep 18, 2018 12:59 am
WWBman wrote: Mon Sep 17, 2018 12:23 pm It works with Radio Buttons but not (currently) for Comboboxes.
E.g. http://www.mediafire.com/file/as7v9n29p ... s.wbs/file
@petejos, are you using Radio Buttons or Comboboxes?
I am using combo boxes. What would you recommend.
Hi WWBman, i would like to know how did you hide your editboxes on loading?
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

In the Object Manager untick Visible.
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Sun Sep 30, 2018 11:52 am In the Object Manager untick Visible.
my form is created with layout grid. i untick the visible but when i load the page and make my selection, the editboxes is not display
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

Did you set the onclick event to Show?
See my test project.
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Sun Sep 30, 2018 12:11 pm Did you set the onclick event to Show?
See my test project.
I did. strangely it doesn't work
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

Does it work as a standard form instead of a layout grid form?
If so then I have no idea what the problem is.
Have you double checked all the id names in the events etc.?
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

I've just tested it with a Layout Grid form and it seems to work.
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Sun Sep 30, 2018 1:14 pm I've just tested it with a Layout Grid form and it seems to work.
Have you have any problem the radio button not showing selected after you selected one of them?
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

I guess you've seen Pablo's reply here:
viewtopic.php?f=5&t=82640&sid=78c960302 ... e9d75bf6ba

FWIW: I've updated my test project to reflect this.
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

New update WWB 14.2 released:
"It is now possible to use multiple (form) conditions with the same value for "equal to (choice)/not equal to (choice)", so you can trigger different actions for the same value."
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Tue Oct 02, 2018 10:20 am New update WWB 14.2 released:
"It is now possible to use multiple (form) conditions with the same value for "equal to (choice)/not equal to (choice)", so you can trigger different actions for the same value."
thanks
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Tue Oct 02, 2018 10:20 am New update WWB 14.2 released:
"It is now possible to use multiple (form) conditions with the same value for "equal to (choice)/not equal to (choice)", so you can trigger different actions for the same value."
Anyway, I have finished my form as below

http://www.goec.com.au/goec2/camprego2019.php
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

Looks good, well done.
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Wed Oct 10, 2018 10:16 am Looks good, well done.
thanks. however, my autoresponder just stopped working for some reason. very strange.
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

hey wwbman,

any idea how to resolve the following issue of mine.

as you are aware my form has selection from 1 to 10. In my autoresponder I also have 1 to 10. However, if the user only select 3, how can I create the autoresponder in such a way that the it will only send 3 to the user who registered? thanks.
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

Isn't this the same issue I mentioned in a previous post?
"It's just occurred to me that when you click e.g. 2 after clicking 3 (and filling in 3) then although the editbox will be hidden the entry for 3 will still be sent in the email so I've added a bit of Javascript (in Page HTML) to clear the relevant boxes.
So I would download the project again to get the improved version
."

I noticed that events with more than one call to a javascript each containing return true; only performs the first one.
So in this case there should be only one javascript in each event which clears all the relevant boxes.
This is done in the test project.
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Fri Oct 12, 2018 8:05 am Isn't this the same issue I mentioned in a previous post?
"It's just occurred to me that when you click e.g. 2 after clicking 3 (and filling in 3) then although the editbox will be hidden the entry for 3 will still be sent in the email so I've added a bit of Javascript (in Page HTML) to clear the relevant boxes.
So I would download the project again to get the improved version
."

I noticed that events with more than one call to a javascript each containing return true; only performs the first one.
So in this case there should be only one javascript in each event which clears all the relevant boxes.
This is done in the test project.
Thanks wwbman This is not my question. Your javascript works for me and it works perfect. Can you try filling up my form and just select either 1 or 2. When you submit and you received a confirmation then you will understand better my question. Thanks.

http://www.goec.com.au/goec2/camprego2019.php
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

Ah, you mean the list of IDs not just the contents.
You will need the following:
document.getElementById('indexEditbox1').disabled = true;
But then there's the problem if the user changes their mind - so you'll have to enable them when they click another button!
e.g. document.getElementById('indexEditbox1').disabled = false;

BTW, it wouldn't allow me to enter a valid postcode but it allowed 11111
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Fri Oct 12, 2018 10:56 am Ah, you mean the list of IDs not just the contents.
You will need the following:
document.getElementById('indexEditbox1').disabled = true;
But then there's the problem if the user changes their mind - so you'll have to enable them when they click another button!
e.g. document.getElementById('indexEditbox1').disabled = false;

BTW, it wouldn't allow me to enter a valid postcode but it allowed 11111
Thanks. By using the script you suggested will the irrelevant IDs which are not in use will not display in the email send to the user?

When you try to enter postcode, what are you trying to enter? Special characters? Because I set the field to only numbers. Thanks wwbman.
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

Correct, disabling will be the same as if the editboxes weren't there in the first place, so won't be included in the email or autoresponder.
Make sure you account for every case.
E.g. if the user fills in 4, then changes their mind and clicks 2, you have to disable 3 and 4.
Then of course if the user clicks 4 again you will have to enable 3 and 4. You see what I mean.
Etc, etc.

DOH!, I've just realised it's in Australia? By using Postcode I assumed it was in the UK so used the UK format.
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Fri Oct 12, 2018 9:35 pm Correct, disabling will be the same as if the editboxes weren't there in the first place, so won't be included in the email or autoresponder.
Make sure you account for every case.
E.g. if the user fills in 4, then changes their mind and clicks 2, you have to disable 3 and 4.
Then of course if the user clicks 4 again you will have to enable 3 and 4. You see what I mean.
Etc, etc.

DOH!, I've just realised it's in Australia? By using Postcode I assumed it was in the UK so used the UK format.
Thanks wwbman. When disabling will the title of the fields still be there like the following? My main aim if the user only select 1, the non of the other details like below should display in their email at all. I am using HTML format in my autoresponder. Thanks wwbman

Name 2:
DOB 2: DD - MM - YYYY
Age 2:
Age Group 2: Select Camper 2 Age Group
Fees 2:
Allergies and Medical Conditions 2:
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

That’s right. None of the details will show.
If you want to try it just download my test project.
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: Combobox Condition

Post by petejos »

WWBman wrote: Fri Oct 12, 2018 10:56 pm That’s right. None of the details will show.
If you want to try it just download my test project.
Thanks wwbman.
You mean even the title like below all will not show as well in the email they received? What is the link to your test project?

Name 2
DOB2
Age 2
WWBman
 
 
Posts: 917
Joined: Fri Jan 08, 2010 6:10 pm

Re: Combobox Condition

Post by WWBman »

The titles will only show for the campers that are filled in.

The link is the same as before: http://www.mediafire.com/file/as7v9n29p ... s.wbs/file
Post Reply