Handles a valid form.
768465
def form_valid(self, form):
        
        response = super().form_valid(form)
        messages.success(self.request, self.success_message)
        return response
42963
protected function processValues()
    {
        $form = $this->getForm();
        $data = &$form->getFormData();

        if (isset($data[$this->id])) {
            if (is_array($data[$this->id])) {
                $this->values = $data[$this->id];
            } elseif ($data[$this->id] != '') {
                $this->values = array($data[$this->id]);
            } else {
                $this->values = array();
            }
        } else {
            $this->values = array();
        }
    }
395482
function handleFieldValidated( isValid, msg ) {
		var input = this.getInputElement();
		if ( input )
			isValid ? input.removeAttribute( 'aria-invalid' ) : input.setAttribute( 'aria-invalid', true );

		if ( !isValid ) {
			if ( this.select )
				this.select();
			else
				this.focus();
		}

		msg && alert( msg );

		this.fire( 'validated', { valid: isValid, msg: msg } );
	}
394429
def form_valid(self, post_form, attachment_formset, **kwargs):
        
        save_attachment_formset = attachment_formset is not None \
            and not self.preview

        if self.preview:
            return self.render_to_response(
                self.get_context_data(
                    preview=True, post_form=post_form, attachment_formset=attachment_formset,
                    **kwargs
                ),
            )

        # This is not a preview ; the object is going to be saved
        self.forum_post = post_form.save()

        if save_attachment_formset:
            attachment_formset.post = self.forum_post
            attachment_formset.save()

        messages.success(self.request, self.success_message)
        if not self.forum_post.approved:
            messages.warning(self.request, self.approval_required_message)

        return HttpResponseRedirect(self.get_success_url())
511431
def form_valid(self, form):
        
        # Move the topic
        topic = self.object
        old_forum = topic.forum
        new_forum = form.cleaned_data['forum']
        topic.forum = new_forum

        # Eventually lock the topic
        if form.cleaned_data['lock_topic']:
            topic.status = Topic.TOPIC_LOCKED
        else:
            topic.status = Topic.TOPIC_MOVED

        topic.save()
        old_forum.save()

        messages.success(self.request, self.success_message)
        return HttpResponseRedirect(self.get_success_url())
380278
def form_invalid(self, form, forms, open_tabs, position_form_default):
        
        # return self.render_to_response( self.get_context_data( form = form, forms = forms ) )
        return self.render_to_response(self.get_context_data(form=form, forms=forms, open_tabs=open_tabs, position_form_default=position_form_default))
857042
def process_form(self, instance, field, form, empty_marker=None,
                     emptyReturnsMarker=False, validating=True):
        
        service_uids = form.get("uids", [])
        return service_uids, {}
91470
def form_valid(self, form):
        """"""
        form.categorize_metrics()
        return super(CategoryFormView, self).form_valid(form)
403590
def form_valid(self, form):
        """"""

        ret = super(HookCreate, self).form_valid(form)

        # Good to make note of that
        messages.add_message(self.request, messages.SUCCESS, 'Hook %s created' % self.object.url)

        return ret
1346091
def form_valid(self, forms):
        
        for key, form in forms.items():
            setattr(self, '{}_object'.format(key), form.save())
        return super(MultipleModelFormMixin, self).form_valid(forms)
928844
protected function validateForm()
    {
        if (2 == $this->currentStep) {
            return true;
        }
        // Note we use an MUtil_Form
        return $this->_form->isValid($this->formData, $this->disableValidatorTranslation);
    }
86228
def handle_verification_form(form):
    """"""
    form.process(formdata=request.form)

    if form.validate_on_submit():
        send_confirmation_instructions(current_user)
        # NOTE: Flash message.
        flash(_("Verification email sent."), category="success")
194408
def form_valid(self, form):
        
        self.check_and_delete_test_cookie()
        login(self.request, form.get_user())
        return super(LoginView, self).form_valid(form)
1303042
def process_formdata(self, valuelist):
        """"""
        if valuelist:
            self.data = '\n'.join([
                x.strip() for x in
                filter(lambda x: x, '\n'.join(valuelist).splitlines())
            ])
322593
function validateForm() {

            var isValid = isEmpty(errors);

            formData = {};

            $.each(
                node.find('input:not([type="submit"]), select, textarea').not(':disabled'),
                function(index, input) {

                    input = $(input);

                    var value = _getInputValue(input[0]),
                        inputName = input.attr('name');

                    if (inputName) {
                        if (/\[]$/.test(inputName)) {
                            inputName = inputName.replace(/\[]$/, '');
                            if (!(formData[inputName] instanceof Array)) {
                                formData[inputName] = [];
                            }
                            formData[inputName].push(value)
                        } else {
                            formData[inputName] = value;
                        }
                    }

                    if (!!input.attr(_data.validation) || !!input.attr(_data.regex)) {
                        if (!validateInput(input[0], value)) {
                            isValid = false;
                        }
                    }
                }
            );

            prepareFormData();

            return isValid;

        }
967334
def form_valid(self, form):
        """"""

        ret = super(ProjectCopy, self).form_valid(form)
        self.copy_relations()

        # Good to make note of that
        messages.add_message(self.request, messages.SUCCESS, 'Project %s copied' % self.object.name)

        return ret
766251
public function validateForm()
    {
        $validator = $this->getValidationFactory()->make(
            $this->requestData(),
            $this->rules()
        );

        if ($validator->fails())
            throw new \Exception($this->formatErrors($validator->errors()));
    }