Form validation not working with tabs x in yii2 - ajax

I am using kartik-v tabs x. My paage has 3 tabskartik v tabs x
In each tab there is a form and a grid.
The form validation works in the first tab but not working in the inside tabs. The form is rendered using renderAjax. Also none of jquery work in the inside tabs.
Can anyone help here?

I could solve the above problem.
When you use tabs and there are forms in it. Each form should have a separate id.
Then the default YII validation works for all tabs

You have to use pjax;
inside the rendered view you have to add this:
Pjax::begin();
$form = ActiveForm::begin(
ActiveForm::end();
Pjax::end();
So u can use pjax for the validation. Let me now if it works.

I have 3 tabs and two of them have both a form and grid and the third only has a grid. The validation and submission all will work if you use different ids for your forms and your js function names should be different.

Related

How to programmatically load different partial views in same template page in umbraco 7?

Can anyone give me an idea about how to do this? My goal is to build a multi step claim submission form where user need to provide information for different sections. I am using VS2015 and Umbraco 7. Thanks.
In my opinion if you want to do it all from one template, it would be best to use a javascript/jquery solution that hides and shows different sections/divs as needed. These divs can be rendered from the partial views. I'm not sure if this works but maybe if you have one Form and all of these divs underneath it, you only need one form button and just submit at the end (I'm pretty positive this would work as the partial view elements would just be rendered as elements inside the form). But if not the values can be stored either in Jquery Data, or just using hidden variables, etc.

Dropzone js not working with another inputs

I want to use Dropzone.js into a form with more than one inputs but it's not working properly.It's only working with a single form but not with more than one inputs in a single form. Is there any code which can help me...
Did you read this link? >> https://github.com/enyo/dropzone/wiki/Upload-all-files-with-a-button
It's a dropzone.js' tutorial explaing how to get all your form submit when you click submit button.

Django crispy form, hide/show fields in the template

i'm using Crispy-Form and Bootstrap within Django. It works very well.
Now, i would like to have a field showing only when another field has input.
Basically i've a multpile select list called A visible, and a text field, B, hidden.
once the the user focus/select one or more value in A, B should become visible. And if none are selected it should become invisible.
Does cripsy form have this feature or the possibility to write the JS?
Or do i've to write the JS in the html page where the form is rendered?
ciao
I've done something similar once. I assigned a class 'hidden' to the inputs that you want to be initially hidden. This can be done by nesting the fields in a Div, and assigning a css_class. See http://django-crispy-forms.readthedocs.org/en/d-0/layouts.html#universal-layout-objects
Then use javascript to remove the 'hidden' class when a certain action occurs.
If you decide to use jQuery, you can use the following function:
$("input[name='a_hidden_field']").removeClass('hidden')

Telerik MVC Grid in Form tag

I have placed Telerik MVC grid in form.but it it giving me followin problem.
if i edit any row and then click update,then control goes to select method instead of update method of the controller.
can you please suggest me any solution?
Thanks,
Makarand Salvi
The grid is internally generating a tag because it is needed for editing. However nested forms are not supported by any browser. The only solution is to put the grid out of the tag.

How to create an AJAXified form within the Zend Framework

I'm trying to create a contact form. However at the top of the form the user can select using radio buttons whether he's contacting the technical department or the marketing department. Depending on which he selects, the entire form changes.
How would this be implemented within the Zend Framework? I'm already extending Zend_Form to make my forms. Also I'm working within the MVC style and would rather not break out of it.
Right now I simply do
echo $this->form;
in the view to render the form. I'm guessing that when the visitor clicks on one of the radio buttons, the controller will need to set a different form, but I'm not too sure how to go about that without re-rendering the entire page.
Thanks!
EDIT
I'm now thinking just setting something like this in the controller:
$this->view->contactFormTechDep = $formTechDep;
$this->view->contactFormMarketingDep = $formMarketingDep;
and render both, but hiding one all using Javascript.
I think you just need to show/hide the content of the form with JavaScript, not with php.
(with jQuery this can easyli be done)
But you'll have to keep in mind to be unobtrusive for users without javascript enabled

Resources