Conditions on an editbox in a form dont work.

Issues related to forms.
Post Reply
jjq2r01h
 
 
Posts: 19
Joined: Sun Aug 23, 2020 4:31 pm

Conditions on an editbox in a form dont work.

Post by jjq2r01h »

I have a problem with a form I have created. The form is at https://hanumanchalisa4cruk.org/
The conditions I have specified on checkbox2 object work perfectly well.
However, the conditions I have specified on editbox12 dont work at all. I would like that when the value of editbox12 < 50 then hide checkbox2 and when the value of editbox12 > 50, then display checkbox2
I can upload the wbs file if need be but I dont know how.
Any help would be appreciated.
Many thanks / Jag
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Conditions on an editbox in a form dont work.

Post by Pablo »

I cannot see what you have done based on the published page.
To be able able to help you, I need a (demo) project.

Related FAQ:
https://www.wysiwygwebbuilder.com/forum ... 10&t=82134

Note: I do not need the complete project. So, please remove everything from the project that is not relevant to your question.
jjq2r01h
 
 
Posts: 19
Joined: Sun Aug 23, 2020 4:31 pm

Re: Conditions on an editbox in a form dont work.

Post by jjq2r01h »

Many thanks for your msg. Here is a link to my project.

https://1drv.ms/u/s!Ajp8jGjiAz6ShpdAjv8 ... Q?e=dBMjJM

Jag
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Conditions on an editbox in a form dont work.

Post by Pablo »

You cannot use 'greater than' and 'lesser than in the same condition, this will cause a conflict.

Code: Select all

if ($('#Editbox12').val() > 50 && $('#Editbox12').val() < 50)
{
         ShowObject('wb_Checkbox2', 0);
         ShowObject('wb_Checkbox2', 1);
}
Instead use 'else', which results in:

Code: Select all

if ($('#Editbox12').val() < 50)
{
   ShowObject('wb_Checkbox2', 0);
}
else
{
   ShowObject('wb_Checkbox2', 1);
}
jjq2r01h
 
 
Posts: 19
Joined: Sun Aug 23, 2020 4:31 pm

Re: Conditions on an editbox in a form dont work.

Post by jjq2r01h »

Thank you very much Pablo. That works great. I presume you just have to manually change the javascript after publishing the project.

I dont know much about creating websites but I dabble into it whenever we have events to raise money for charity.

Where is the best place to learn about creating websites and using your package?

Also, do you know of anybody (especially in India) who uses wysiwyg web builder to develop websites who I can hire perhaps to do some small developments?
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Conditions on an editbox in a form dont work.

Post by Pablo »

You do not have to edit the code.
'else' is one of the available conditions.

So, instead using
'less than' and greater than'
use
'less than' and 'else'
Where is the best place to learn about creating websites and using your package?
- help (F1)
- tutorials : https://www.wysiwygwebbuilder.com/getting_started.html
- this forum
Post Reply