Click here to Skip to main content
15,885,979 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a html code with two tabs(Users and Groups)..Now,when i click on first tab,i should display the "Users" tab content by dynamically fetching records from database and similarly for second tab "Groups" tab contents.

But i am having problem fetching the second tab-content and displaying them when second tab is clicked (On second tab click,it should also display a button which is hidden).



I can get the tab contents if i manually change the url to Users/Groups after removing the formAction="". but the problem is with handling the "onclick" event and "formaction" at once.

Please help.

What I have tried:

HTML
<form action="/home_page/user" method="post" novalidate>{% csrf_token %}

<div class="tab">
      <button class="tablinks" onclick="openCity(event, 'users'); myfunction();" >Users</button>
      <button class="tablinks" onclick="openCity(event, 'groups'); myfunction2();" formaction="/home_page/group">Groups</button>
</div>

</form>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900