Remove content of hidden fields

  • Posts: 42
  • Thank you received: 3
  • Hikashop Business
2 weeks 16 hours ago #363001

-- url of the page with the problem -- : shangshungpublications.com/
-- HikaShop version -- : 5.1.0
-- Joomla version -- : 5.1.4
-- PHP version -- : 8.2

Hi,
I've made conditional fields, ie. "vat" field shown only if the customer type is set to "company" with a radio button. If the customer set the "vat" field then he decide to change the "company" field to "private", the "vat" field, correctly, becomes hidden but its value remains. Is it possible to delete automatically the value of hidden fields?
Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 82426
  • Thank you received: 13274
  • MODERATOR
2 weeks 10 hours ago #363004

Hi,

Do you mean that you want the value to be removed from the input on the fly in javascript because you have some custom javascript that reads this value and it needs to reflect the state of the parent field ?
Or do you mean that the value previously entered in the input is stored in the database and you don't want that to happen ?
While the first is a bit difficult, the second should already be the case without doing anything.

Supposing that you're talking about the first, the problem is that each field type can have different ways to store what the user provides. So the javascript needs to adapt to that. However, since the javascript of the custom field system doesn't know how the HTML of the type handles itself, it means that we would need to build a system where each custom field would add its own javascript to be triggered to empty itself. It's a lot of work for something which should be manageable easily in your own javascript if you're already have your own custom javascript code. Or maybe I'm missing something on what you're trying to do ?

Please Log in or Create an account to join the conversation.

Time to create page: 0.049 seconds
Powered by Kunena Forum