How to use Tabs getActiveTab() in form
Hi, everyone.
I have two tabs in one form. and i want to get active tab id when tab changed.
How we can get active tab id with getActiveTab() such in TextInput ?
9 Replies
Please ask about the actual problem you're trying to solve, instead of your attempted solution. https://xyproblem.info
Does anyone have any comments?
the question is very vague and we dont know what you are talking about. what do you want to do? tell us more information
I have two tabs in one form. and i want to get active tab id when tab changed.
i dont think thats possible on the backend because its a javascript property
if you want it on the frontend then please be specific as to where.
so , how we can use getActiveTab()? just in backend?
Where are you trying to get the active tab and how are you trying to use it?
I have one field address_id for chose one address from user addresses in tab #1
and i have card for insert new address fields in tab #2
i need to set requred() to addres_id field in tab #1 if tab 1 activated
and set required() to all fileds in tab 2 , if tab 2 activated.
So, just make those fields in tab 2 required if the field in tab one is null. The actual tab doesn’t matter.
Sounds like a form wizard might be more appropriate than tabs in this case though.
But with tabs it’s still all part of the same form, so you can validate against the value of a field in another tab.
You can get values from other tabs using the ../field syntax with the $get closure.