Jump to content


Show/Hide field from Dropdown


  • Please log in to reply
2 replies to this topic

#1 Julio

Julio

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts
  • LocationBrazil

Posted 20 November 2017 - 03:16 PM

Hi everyone,

 

I have a dropdown list field that, when selecting item 1, must hide the X field and display the Y one, selecting item 2 should reverse the action.
 
The content loaded in the list is in a table and there is a field in the item that defines its behavior.
 
I believe the solution is to use JS, but could someone please help me with an example and where to enter the code?
 
 
Thanks.
 
 
Julio.

 



#2 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 21 November 2017 - 04:30 AM

Hi Julio,

 

Well you can refer to the following post to understand the same...

http://www.amitsgara...-add-edit-page/

 

There is a simple way around. Each field have have a name lets say contactFirstName. Each div container have a class assigned to the same..

contactFirstName_form_group

The <fieldname>_form_group is a class assigned to the div container of the field.

So - its simple - u just need to pick up the class name - show / hide.. do whatever you like.

 

Happy GCing :)



#3 Julio

Julio

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts
  • LocationBrazil

Posted 21 November 2017 - 09:33 PM

Hi Amit,

 

Sorry my lack of knowledge, but would you have an example code?

 

How can I get from dropdown a field value related the list item that's set in the table?

 

Thanks,

 

Julio.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users