You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by Kristian Lind <kl...@gmail.com> on 2013/09/05 20:46:59 UTC

Disable form validation before submit.

Hi.

I have a form where a change in a dropdown is submitting the form to
populate other fields, depending what was chosen in the dropdown.

My problem is, that the form validation is returning an error, because some
fields were not provided.
So I wanna disable the form validation until the save button is pressed...

see attached pictures and the java file.




-- 
Best regards

Kristian Lind

Re: Disable form validation before submit.

Posted by Kristian Lind <kl...@gmail.com>.
Thanks that worked.


On Thu, Sep 5, 2013 at 12:43 PM, Gilberto <gi...@gmail.com> wrote:

> You can disable form validation[1] when you aren't saving. Something like :
>
> [code]
>
>  // If save was not clicked, don't validate
>         if(form.isFormSubmission() && !save.isClicked()) {
>             form.setValidate(false);
>         }
>
>
> [/code]
>
>
> [1]
> http://click.avoka.com/click-examples/source-viewer.htm?filename=WEB-INF/classes/org/apache/click/examples/page/form/dynamic/PopulateOnSelect.java
>
>
>
> 2013/9/5 Kristian Lind <kl...@gmail.com>
>
>> Hi.
>>
>> I have a form where a change in a dropdown is submitting the form to
>> populate other fields, depending what was chosen in the dropdown.
>>
>> My problem is, that the form validation is returning an error, because
>> some fields were not provided.
>> So I wanna disable the form validation until the save button is
>> pressed...
>>
>> see attached pictures and the java file.
>>
>>
>>
>>
>> --
>> Best regards
>>
>> Kristian Lind
>>
>
>


-- 
Best regards

Kristian Lind

Re: Disable form validation before submit.

Posted by Gilberto <gi...@gmail.com>.
You can disable form validation[1] when you aren't saving. Something like :

[code]

 // If save was not clicked, don't validate
        if(form.isFormSubmission() && !save.isClicked()) {
            form.setValidate(false);
        }


[/code]


[1]
http://click.avoka.com/click-examples/source-viewer.htm?filename=WEB-INF/classes/org/apache/click/examples/page/form/dynamic/PopulateOnSelect.java



2013/9/5 Kristian Lind <kl...@gmail.com>

> Hi.
>
> I have a form where a change in a dropdown is submitting the form to
> populate other fields, depending what was chosen in the dropdown.
>
> My problem is, that the form validation is returning an error, because
> some fields were not provided.
> So I wanna disable the form validation until the save button is pressed...
>
> see attached pictures and the java file.
>
>
>
>
> --
> Best regards
>
> Kristian Lind
>