Desactivation of a question on client side (javaScript)Desactivation of a question on client side (javaScript)https://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1058224112024-03-29T15:06:49Z2024-03-29T15:06:49ZRE: Desactivation of a question on client side (javaScript)Andrew Jardinehttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1058247932018-03-26T13:21:23Z2018-03-26T13:21:23ZHi Jhon,<br /><br />A couple of questions for you --<br /><br />1. Which version of Liferay are you using? (assuming 7/DXP)?<br /><br />2. Is this a custom portlet? or an out of the box Liferay portlet?<br /><br />3. Can you tell us what the portlet is?<br /><br />4. If it is a Liferay 7 solution you are working with, and the portlet is custom, do you have a *Command class you have written?<br /><br />5. Can you share with us the URL that is invoked when you submit?Andrew Jardine2018-03-26T13:21:23ZDesactivation of a question on client side (javaScript)Jhon miladbhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1058224102018-03-26T12:11:27Z2018-03-26T12:11:27Z<html><head></head><body>Hello everybody,<br><br>I need to hide a question created in liferay on client side, for A/B testing. Due to production process, the IT can't desactivate this question before several weeks/ months. I read several links and try several methods.<br><br>By overwritten the rules, I succeeded to desactivate it on client side:<br><br><pre><code> _myPortlet_validator.set('rules', {devisdeces_myPortlet_choixUn2 : {
_myPortlet_selection: false,
required : false
},
_myPortlet_choixRevalorisation : {
_myPortlet_selection: false,
required : false
}})
_myPortlet_validator.set('fieldStrings', {})</code></pre><br><br>If I click on submit, I don't have an error message. When I fill all the questions then submit the page, following the reloaded of the page, I have an error message (you must fill the question). It seems that there is a validation on server side.<br><br>How can I remove the validator of the hidden question on client side ? Can I add a default value if I can't remove the validator code ?<br><br>