I am trying to make a Registration form for my department. We have Divisions and under each divisions we have several Sections. My purpose was during registration if an employee selects Division only Sections related to that Division alone should show; not all the sections. Like we select country only that country states get displayed. Similarly is it possible to autopopulate feild using Joomla User Fields.

  • This post is a "requirements dump", but questions should attempt to lighten the load that is asked of volunteers as matter of common respect and to make the question more attractive to answer. Please include your work/effort to self-solve as well as any relevant research that you have conducted.
    – mickmackusa
    Apr 8 '20 at 0:18
  • 1
    I have been here for last 8 years. I know how to ask Questions. I feel you just judge a question by its looks. Code is not given and you dont know the answer so simply give some comments to show superiority. Isnt it. Please read the question once more.
    – Amit Ray
    Apr 8 '20 at 10:28
  • 1
    Are you using a third party extension to create the form or is it the default Joomla registration form? What have you tried so far? There are many third party extensions that can do this. The more information you provide the more we can help :)
    – jonboy
    Apr 8 '20 at 10:33
  • Its core joomla only. No third party extension. As I mentioned when I am entering all the Divisions and Sections. I want to filter sections for particular Division. But now suppose I select any Division all sections are shown not just related to that Division. I am creating a componet so I thought I can use core Joomla. But now I think they dont have, so I am custom coding now.
    – Amit Ray
    Apr 8 '20 at 10:33
  • Years as a registered user in a given community have nothing to do with the completeness/quality of a post. I am asking you to improve your question for the benefit of researchers and volunteers. If you find this to be confrontational/insulting then that is your problem, not mine. If you don't want to take my advice, then don't, but what exactly are you risking by posting additional relevant details? After 4 years in this community, you have 2 questions and 2 answers -- I don't think your posts are above reproach. The righteousness is wasted on me. Yes, I judge posts by how they look.
    – mickmackusa
    Apr 8 '20 at 10:49

You can use the "showon" field attribute to hide/show a field depending upon the value of another field. So you could have lots of Sections fields - one for each Division - and show only the appropriate Section field based on the value of the Division field. As all this is going to be fairly dynamic you'd want to build up your form dynamically from Division/Section data in a database table - see eg https://docs.joomla.org/Advanced_form_guide#Dynamically_Changing_Forms - rather than defining it in an XML file.

Alternatively you could write some javascript which is triggered on the user setting the Division field, and which would perform an Ajax query to get the associated Sections for that Division, and inject these into the options for the Section field. That way, you'd only need 1 Section field and set the options dynamically using js. This is what I'd do personally.

Or as Jonboy suggests, find an appropriate 3rd party extension; I can't help there, I'm afraid.

  • Thanks a lot. That's really a useful link. I will go through that and if i find some solution i will post it here so that it can help others.
    – Amit Ray
    Apr 9 '20 at 10:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.