how to make input widget in visible based on selection of item in combobox widget

how to make input widget in visible based on selection of item in combobox widget

  


Hi All,

I have a webscreen with several input widgets and also set of combobox widgets.I want to make a set of input widgets invisible(visible=false) upon selection of an item from a combobox.

Thanks,
Prashanth

Hi Prashanth,

On the combobox onchange, and if is the value which make the input widget invisible, put the RunJavaScript action with this code:

" document.getElementById('"+InputWidget.Id+"').style.display = none;"

Or if you can put all the input widgets inside a container, put that code instead  of the above:

" document.getElementById('"+Container.Id+"').style.display = none;"

Best Regards,
Diogo Miguel

Hello,

A different approach is by using jQuery and creating the event directly on the page with an unescape expression. 

Something like this (inside an unescape expression):

"<script type='text/javascript'>
osjs('#"+ComboWidgetId+"').change(function () {
         osjs('
#"+InputId+"').toogle();
}
<script/>"


By doing like this it will run everything on the client side. RunJavascript is done on server side. Try to use it only when is really not possible to do it on the client side.

Best Regards,
Hugo Pinheiro


Diogo Miguel wrote:
Hi Prashanth,

On the combobox onchange, and if is the value which make the input widget invisible, put the RunJavaScript action with this code:

" document.getElementById('"+InputWidget.Id+"').style.display = none;"

Or if you can put all the input widgets inside a container, put that code instead  of the above:

" document.getElementById('"+Container.Id+"').style.display = none;"

Best Regards,
Diogo Miguel
 
 Hi Miguel,
Thanks a lot for reply.It is working perfectly fine.Also as  Pinheiro suggested i will try to implement at client side as well.

Thanks,
Prashanth
Hugo Pinheiro wrote:
Hello,

A different approach is by using jQuery and creating the event directly on the page with an unescape expression. 

Something like this (inside an unescape expression):

"<script type='text/javascript'>
osjs('#"+ComboWidgetId+"').change(function () {
         osjs('
#"+InputId+"').toogle();
}
<script/>"


By doing like this it will run everything on the client side. RunJavascript is done on server side. Try to use it only when is really not possible to do it on the client side.

Best Regards,
Hugo Pinheiro

 
 Hi Pinheiro,
 
Thanks for the reply.Using Server side action RunJavaScript() it is working fine.I will try your approach as well.

Thanks,
Prashanth