Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alpaca Forms validation show error message only after user leaves field (leaves the field)

All the fields marked required are in red when the form loads since they are blank. How do I change this so that they only turn red (check validation) if/when someone leaves a particular field. This is specific to Alpaca forms.

        $(document).ready(function() {
            $("#form").alpaca({
                "schema": {
                    "title":"User Feedback",
                    "description":"What do you think about Alpaca?",
                    "type":"object",
                    "properties": {
                        "volunteer_name": {
                            "type":"string",
                            "title":"Name of Civic Tutor",
                            "required":true
                        },
                    }
                }
            });
        });
like image 907
Saurabh Maurya Avatar asked May 22 '16 05:05

Saurabh Maurya


1 Answers

Oh, there's actually a very simple solution to this. Just add a "options": {"hideInitValidationError":true,....} to your form.

like image 110
Saurabh Maurya Avatar answered Oct 29 '22 20:10

Saurabh Maurya