Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

using nuHide to hide a file input object

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
nickrth
Posts: 28
Joined: Sun Aug 23, 2020 3:19 pm
Has thanked: 1 time
Been thanked: 1 time

using nuHide to hide a file input object

Unread post by nickrth »

Hi there,

I have a basic bit of JavaScript that I'm using to hide an object based on a value on the form.

Code: Select all

    var dt   = $('#dish_mealtype_id').val();
    if (!(dt=="2" || dt=="4" || dt=="6" || dt=="7"))
        {
        nuHide('recipe_card');
        nuHide('dish_image_upload');
        }
It hides the recipe_card object card beautifully, but the dish_image_upload is not hidden.

recipe_card object is a button run object
dish_image_upload is a file input object

Any thoughts as to why this might be the case? Or if I'm doing something wrong?

Many thanks in advance for any help you can provide.
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: using nuHide to hide a file input object

Unread post by kev1n »

Hi,

I'll fix the nuHide() function later. For now, use this JavaScript code:

Code: Select all

function hideFileObject(i) {
  nuHide(i);
  nuHide(i + '_file');
}

hideFileObject('dish_image_upload');
nickrth
Posts: 28
Joined: Sun Aug 23, 2020 3:19 pm
Has thanked: 1 time
Been thanked: 1 time

Re: using nuHide to hide a file input object

Unread post by nickrth »

Hi Kev1n,

That worked perfectly. Thanks so much for your prompt help, really appreciate it.
Post Reply