Page 1 of 2

Re: Combobox Condition

Posted: Thu Sep 27, 2018 12:15 pm
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.

Re: Combobox Condition

Posted: Thu Sep 27, 2018 12:24 pm
by WWBman
Sorry but it works for me.
Can you share your .wbs file to see if I can spot any problem?

Re: Combobox Condition

Posted: Thu Sep 27, 2018 11:26 pm
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.

Re: Combobox Condition

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

Re: Combobox Condition

Posted: Sun Sep 30, 2018 8:26 am
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.

Re: Combobox Condition

Posted: Sun Sep 30, 2018 8:53 am
by WWBman
Try:
document.getElementById('Combobox1').options.length = 0;
or just:
Combobox1.options.length = 0;

Re: Combobox Condition

Posted: Sun Sep 30, 2018 9:24 am
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

Re: Combobox Condition

Posted: Sun Sep 30, 2018 9:44 am
by WWBman
Try:
Combobox1.reset();

Re: Combobox Condition

Posted: Sun Sep 30, 2018 9:51 am
by petejos
WWBman wrote: Sun Sep 30, 2018 9:44 am Try:
Combobox1.reset();
Truly appreciated your quick respond. It still doesn't reset. :(

Re: Combobox Condition

Posted: Sun Sep 30, 2018 10:07 am
by WWBman
As you probably gathered I'm not a Javascript expert!!
If the user is selecting one item then try:
Combobox1.selectedIndex = 0;

Re: Combobox Condition

Posted: Sun Sep 30, 2018 10:15 am
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.

Re: Combobox Condition

Posted: Sun Sep 30, 2018 11:40 am
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?

Re: Combobox Condition

Posted: Sun Sep 30, 2018 11:52 am
by WWBman
In the Object Manager untick Visible.

Re: Combobox Condition

Posted: Sun Sep 30, 2018 11:59 am
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

Re: Combobox Condition

Posted: Sun Sep 30, 2018 12:11 pm
by WWBman
Did you set the onclick event to Show?
See my test project.

Re: Combobox Condition

Posted: Sun Sep 30, 2018 12:44 pm
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

Re: Combobox Condition

Posted: Sun Sep 30, 2018 12:54 pm
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.?

Re: Combobox Condition

Posted: Sun Sep 30, 2018 1:14 pm
by WWBman
I've just tested it with a Layout Grid form and it seems to work.

Re: Combobox Condition

Posted: Mon Oct 01, 2018 6:01 am
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?

Re: Combobox Condition

Posted: Mon Oct 01, 2018 7:47 am
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.

Re: Combobox Condition

Posted: Tue Oct 02, 2018 10:20 am
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."

Re: Combobox Condition

Posted: Wed Oct 10, 2018 10:01 am
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

Re: Combobox Condition

Posted: Wed Oct 10, 2018 10:03 am
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

Re: Combobox Condition

Posted: Wed Oct 10, 2018 10:16 am
by WWBman
Looks good, well done.

Re: Combobox Condition

Posted: Wed Oct 10, 2018 10:18 am
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.

Re: Combobox Condition

Posted: Fri Oct 12, 2018 6:34 am
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.

Re: Combobox Condition

Posted: Fri Oct 12, 2018 8:05 am
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.

Re: Combobox Condition

Posted: Fri Oct 12, 2018 10:25 am
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

Re: Combobox Condition

Posted: Fri Oct 12, 2018 10:56 am
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

Re: Combobox Condition

Posted: Fri Oct 12, 2018 9:13 pm
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.

Re: Combobox Condition

Posted: Fri Oct 12, 2018 9:35 pm
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.

Re: Combobox Condition

Posted: Fri Oct 12, 2018 10:51 pm
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:

Re: Combobox Condition

Posted: Fri Oct 12, 2018 10:56 pm
by WWBman
That’s right. None of the details will show.
If you want to try it just download my test project.

Re: Combobox Condition

Posted: Fri Oct 12, 2018 11:36 pm
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

Re: Combobox Condition

Posted: Sat Oct 13, 2018 8:02 am
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

Re: Combobox Condition

Posted: Sat Oct 13, 2018 10:08 am
by petejos
WWBman wrote: Sat Oct 13, 2018 8:02 am 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
I inserted the function you mentioned as below for Camper2Name
function clearbox2()
{
document.getElementById('Fee2').value = "";
document.getElementById('Camper2Group').value = "";
document.getElementById('Camper2Age').value = "";
document.getElementById('Camper2conditions').value = "";
document.getElementById('Camper2Name').disabled = true;
Camper2Group.selectedIndex = 0;
Camper2DOBYear.selectedIndex = 0;
Camper2DOBMonth.selectedIndex = 0;
Camper2DOBDate.selectedIndex = 0;
}

The result i got in the email is as below. Any idea what have I done wrong>:(

Name 2: $Camper2Name
DOB 2: DD - MM - YYYY
Age 2:
Age Group 2: Select Camper 2 Age Group

Re: Combobox Condition

Posted: Sat Oct 13, 2018 10:26 am
by WWBman
You'll need to disable all elements in the group.
Have you looked at my test project?
I have tested it and it works.

BTW, you don't need the selectedIndex = 0; option, that was for a Combobox.

Re: Combobox Condition

Posted: Sun Oct 14, 2018 12:36 am
by petejos
WWBman wrote: Sat Oct 13, 2018 10:26 am You'll need to disable all elements in the group.
Have you looked at my test project?
I have tested it and it works.

BTW, you don't need the selectedIndex = 0; option, that was for a Combobox.
Thanks Wwbman.

The following is what the message I have in my autoresponder. I have 10 campers details in this message. As you can see I have say 2 campers details below as an example. If you register only for 1 camper, you will still receive all the following format, but only with camper 1 details. What I want to achieve is if the user only register for 1 camper, then the camper 2 should not be included in the autoresponder message. I looked through your test project and it doesn't seems like what I am looking for. Hope you understand what I wanted to achieve and you may possibly have the solution for me? Thanks again WWBman

Hi $ContactName.

Thank you for registering the 2019 English Church Family Camp

Your reference number is: $reference

You have submitted below information:

Total Number of Campers in this registration you have submitted is: $HowManyCampers

Camper Details
Name 1: $Camper1Name
DOB 1: $Camper1DOBDate - $Camper1DOBMonth - $Camper1DOBYear
Age 1: $Camper1Age
Age Group 1: $Camper1Group
Fees 1: $Fee1
Allergies and Medical Conditions 1: $Camper1conditions


Name 2: $Camper2Name
DOB 2: $Camper2DOBDate - $Camper2DOBMonth - $Camper2DOBYear
Age 2: $Camper2Age
Age Group 2: $Camper2Group
Fees 2: $Fee2
Allergies and Medical Conditions 2: $Camper2conditions

Re: Combobox Condition

Posted: Sun Oct 14, 2018 7:40 am
by WWBman
I know exactly what you want, my test project does that.
Have you downloaded the project?
You can just preview it and you'll see that e.g. if you select just one item then the details for just that one item will be sent, nothing else.
The details sent include the titles + entered data.

Please compare the events and javascript with what you have, especially the clear..() routines.

Re: Combobox Condition

Posted: Sun Oct 14, 2018 8:00 am
by petejos
WWBman wrote: Sun Oct 14, 2018 7:40 am I know exactly what you want, my test project does that.
Have you downloaded the project?
You can just preview it and you'll see that e.g. if you select just one item then the details for just that one item will be sent, nothing else.
The details sent include the titles + entered data.

Please compare the events and javascript with what you have, especially the clear..() routines.
Thanks WWBMan. Just want to clarify. I don't want anything at all that are not selected by the user to appear in the email. For example. If the user select only 1, i don't want any of the following info related to the 2 to appear in the email at all. Because I am using HTML as email format, I just can't find a way not to have the following information sent to the user even though they only selected 1.

Name 2:
DOB 2:
Age 2:
Age Group 2: Select Camper 2 Age Group
Fees 2:
Allergies and Medical Conditions 2:

As mentioned early, presently I configure my autoresponder as
Reference number: $reference

Number of Campers: $HowManyCampers

Camper Details
Name 1: $Camper1Name
DOB 1: $Camper1DOBDate - $Camper1DOBMonth - $Camper1DOBYear
Age 1: $Camper1Age
Age Group 1: $Camper1Group
Fees 1: $Fee1
Allergies and Medical Conditions 1: $Camper1conditions


Name 2: $Camper2Name
DOB 2: $Camper2DOBDate - $Camper2DOBMonth - $Camper2DOBYear
Age 2: $Camper2Age
Age Group 2: $Camper2Group
Fees 2: $Fee2
Allergies and Medical Conditions 2: $Camper2conditions

Re: Combobox Condition

Posted: Sun Oct 14, 2018 8:05 am
by petejos
petejos wrote: Sun Oct 14, 2018 8:00 am
WWBman wrote: Sun Oct 14, 2018 7:40 am I know exactly what you want, my test project does that.
Have you downloaded the project?
You can just preview it and you'll see that e.g. if you select just one item then the details for just that one item will be sent, nothing else.
The details sent include the titles + entered data.

Please compare the events and javascript with what you have, especially the clear..() routines.
Thanks WWBMan. Just want to clarify. I don't want anything at all that are not selected by the user to appear in the email. For example. If the user select only 1, i don't want any of the following info related to the 2 to appear in the email at all. Because I am using HTML as email format, I just can't find a way not to have the following information sent to the user even though they only selected 1.

Name 2:
DOB 2:
Age 2:
Age Group 2: Select Camper 2 Age Group
Fees 2:
Allergies and Medical Conditions 2:

As mentioned early, presently I configure my autoresponder as
Reference number: $reference

Number of Campers: $HowManyCampers

Camper Details
Name 1: $Camper1Name
DOB 1: $Camper1DOBDate - $Camper1DOBMonth - $Camper1DOBYear
Age 1: $Camper1Age
Age Group 1: $Camper1Group
Fees 1: $Fee1
Allergies and Medical Conditions 1: $Camper1conditions


Name 2: $Camper2Name
DOB 2: $Camper2DOBDate - $Camper2DOBMonth - $Camper2DOBYear
Age 2: $Camper2Age
Age Group 2: $Camper2Group
Fees 2: $Fee2
Allergies and Medical Conditions 2: $Camper2conditions
I just don't want the title unrelated to the user selection to appear at all.

Re: Combobox Condition

Posted: Sun Oct 14, 2018 8:22 am
by WWBman
I just don't want the title unrelated to the user selection to appear at all.
And that is what the test project does.
Please test it.

Re: Combobox Condition

Posted: Sun Oct 14, 2018 9:33 am
by petejos
WWBman wrote: Sun Oct 14, 2018 8:22 am
I just don't want the title unrelated to the user selection to appear at all.
And that is what the test project does.
Please test it.
Thanks WWBman. I tested and it doesn't work the way I wanted. check out below

http://www.goec.com.au/goec2/page4.php

Re: Combobox Condition

Posted: Sun Oct 14, 2018 10:51 am
by WWBman
You haven't redownloaded the project.
That one is a very old version.

Re: Combobox Condition

Posted: Sun Oct 14, 2018 11:20 am
by petejos
WWBman wrote: Sun Oct 14, 2018 10:51 am You haven't redownloaded the project.
That one is a very old version.
Thanks WWBman. I downloaded a new one and noticed the different in the script. However, I tested and it still doesn't work. Please have a look.

http://www.goec.com.au/goec2/page4.php

Re: Combobox Condition

Posted: Sun Oct 14, 2018 11:29 am
by WWBman
Can you share the test project you have just used (or email me it)?
Did you change anything in it?
I entered data in the first box and this was blank in the email so something must have changed!

Re: Combobox Condition

Posted: Sun Oct 14, 2018 8:16 pm
by petejos
WWBman wrote: Sun Oct 14, 2018 11:29 am Can you share the test project you have just used (or email me it)?
Did you change anything in it?
I entered data in the first box and this was blank in the email so something must have changed!
Thanks WWBman. Can I have your email pls. Mine is petejos@hotmail.com
Thanks

Re: Combobox Condition

Posted: Sun Oct 14, 2018 8:32 pm
by WWBman
You should have it from the reply to the test run.
Or just copy the .wbs file to the server and I’ll download it from there.

Re: Combobox Condition

Posted: Sun Oct 14, 2018 8:36 pm
by WWBman
Email address sent.

Re: Combobox Condition

Posted: Sun Oct 14, 2018 9:31 pm
by petejos
WWBman wrote: Sun Oct 14, 2018 8:36 pm Email address sent.
wbs file sent