Selectlist with validation and in off-state still produces invalid message.

  • hoekbrwr
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 80
  • Thank you received: 3

hoekbrwr created the topic: Selectlist with validation and in off-state still produces invalid message.

If you Turn off a select list which has a validation script ff_valuenotempty produces always an error message. If you turn it on all is well, signaling error when the first line has been selected.
Could anyone confirm this behaviour?
I am on the latest 1.90 build 931!
#236911
  • Posts: 2553
  • Karma: 87
  • Thank you received: 343

mihaela replied the topic: Selectlist with validation and in off-state still produces invalid message.

Hello,

Can you please send me how you have defined the select list?

So, even though the select list is hidden in the form it produces an error that the element is empty?

Regards,

Mihaela
#236919
  • hoekbrwr
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 80
  • Thank you received: 3

hoekbrwr replied the topic: Selectlist with validation and in off-state still produces invalid message.

I will come back to you later due to a lack of time. I will construct a demo form then!
Well, I could reproduce the phenomena here ndo-dev.leovanderhoek.nl/index.php/2014-...-59/select-list-test .
Attached the form in a package.
#236929
Attachments:
  • hoekbrwr
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 80
  • Thank you received: 3

hoekbrwr replied the topic: Selectlist with validation and in off-state still produces invalid message.

I found out that only the very first time the parent section has been switched on in the form it produces this erroneous behavior when you switched it on - off - on it functions as expected. For me that could be a workaround.
#236932
  • Posts: 2553
  • Karma: 87
  • Thank you received: 343

mihaela replied the topic: Selectlist with validation and in off-state still produces invalid message.

Hello,

I didn't manage to recreate the problem. Whatever I click on the link or packaged for you've sent me it seems to be working fine.

The change that I would do in your form is, I would add to this code in Actionscript of the "chkb_sec" element:
function ff_chkb_sec_action(element, action)
{
	switch (action) {
	case 'change':
		if (element.checked == true) {
			bfToggleFields('on', 'section', 'sec_select', bfDeactivateField);
		} else {
			bfToggleFields('off', 'section', 'sec_select', bfDeactivateField);
		}
	        break;
	default: ;
	} // switch
} // ff_chkb_sec_action
I would add this code:
function ff_chkb_sec_action(element, action)
{
	switch (action) {
	case 'change':
		if (element.checked == true) {
			bfToggleFields('on', 'section', 'sec_select', bfDeactivateField);
		} else {
			bfToggleFields('off', 'section', 'sec_select', bfDeactivateField);
                        getElementsByName("chkb_selectit").checked = false;
			bfToggleFields('off', 'element', 'selectlist', bfDeactivateField);
			ff_getElementByName('selectlist').options[0].selected = true;
		}
	        break;
	default: ;
	} // switch
} // ff_chkb_sec_action
Let me know whether after you change the code that way, the issue is gone.

Regards,

Mihaela
#236933
  • hoekbrwr
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 80
  • Thank you received: 3

hoekbrwr replied the topic: Selectlist with validation and in off-state still produces invalid message.

I really only have the problem the first time the checkbox for the select list is off! After that when having been switched on and off it is fine.
In my original form I have tried things like switching on and off and running the select list event program, the problems stays.
However when i do a submit and the balloon error is on the side and after that I activate the checkbox and choose an option I see the balloon error disappear when I click on a valid choice in the select list.

Please look at it when first use after init of form.
On this form I could get rid of the problem with the 2 extra lines switching on and off the select list. However, my original form needed more. I mimicked the above described procedure to get the validation work correctly.
		ff_getElementByName('chkb_b').checked = true;
		bfToggleFields('on', 'element', 'b_kl', bfDeactivateField);
		ff_getElementByName('b_kl').options[1].selected = true;
		ff_b_kl_action(ff_getElementByName('b_kl').options,'change');
		ff_getElementByName('b_kl').options[0].selected = true;
Where chkb_b is the checkbox to activate the select list under b_kl.
Strangely this procedure did not work in the selectlist form!
#236934
Moderators: ForumSupporttomeperica
Time to create page: 0.067 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here