6 answers
- 10-1
any update how to fix it
- Anders
Hi, perhaps it could be due to the timing. An AJAX call takes a little while before it updates the element, so you could try adding a delay before using JavaScript to make it readonly, like https://www.w3schools.com/jsref/met_win_settimeout.asp
Add your comment... - 10-1
there must something to prevent AJAX from messing with the object.
Add your comment... - 10-1
any update how to fix it
Add your comment... - 10-1
any answers?
- Chris Angel
Perhaps you can try out this code snippet below.
FormUtil.getField('selectBoxFieldIdHere').attr('disabled',true)
But do remember to set disable attribute back to false upon form submission, to allow the value to be stored successfully.
- Hamid Zahrir
Thanks for the reply
I did try this. like I said earlier I need to disable the option box but I need to see what was selected.
this code will not show what was selected
- Hamid Zahrir
I need it to show like this
- Hamid Zahrir
I think II found the problem but I didn't find the solution
when "Use AJAX for cascade options?" is checked I get an empty box when uncheked the code above works. what's the solution to this?
- Hamid Zahrir
definetly AJAX
with AJAX enabled
and when disabled
as you can see the AJAX override the chosen-single with chosen-default
how can i disable ajax then the box is disabled
Add your comment... - 10-1
business rule requires it. when a grid contains rows the selection can't be changed until all rows from the grid are deleted then I will re_enable it. multiselect box is used for a single selection.
Add your comment... - 10-1
To clarify, what is the purpose of setting the multiselect box as readonly via JS? This can already be easily done via the multiselect box config in the Form Builder Multi Select Box#UI
Add your comment...
how can I make multiselect box readonly thru javascript and reader the same result as when you set multiselect as readonly in the form designer. I tried multiple scenarios and every option resulted in either the box disapearing or the box is empty. I want the box grayed out with select value grayed out too.
Thanks!