If a validation error is triggered, it seems that the default values on element don't work

Borox

Member
Hi,

I have some default values on elements, for example:
upload_2017-6-25_21-29-50.png

If no validation error is triggered, no problem I get my default value in the database field, but if a validation error is triggered, then I don't get the default value

I made a simple workaround with a form php plugin which is forcing the values I need, but is it a known problem?

Thanks.
 
What do you mean with "validation error is triggered"?
An invalid user input for the element with the default?
Defaults are only applied when loading the form of a new record.
 
Hi,

Yes, on an invalid user input for the element with the default.

It happens on a new form, if there's no input error, the defaults values are applied, if an error occurs, it doesn't.
 
Default values are no applied - on the element with the wrong input (this is to expect, the user has changed it) or on all elements with default?
 
Hi,

They are not applied on all the elements with defaults ( if there was previously a wrong input on one of the elements)
 
I can't replicate this. Do you have anything "unusual" on your form, like any PHP for or validation plugins?

-- hugh
 
Hi Hugh,

I have some plugin:
upload_2017-6-28_10-4-36.png

And some php in the introduction of the form.
 

Attachments

  • upload_2017-6-28_10-4-26.png
    upload_2017-6-28_10-4-26.png
    4.6 KB · Views: 22
Hi Hugh,

Yes it's on this site. We can see it on this form ( it creates a poll): index.php/collaborer/sondages/creer-un-sondage (form #20 'Sondage pour le conseil syndical ' )
Put a title, leave the date like they are, an error will come up, then change the 2nd date ('Date de fin' must be higher than 'Date de d?but')
The result is in the table #__mijopolls_polls, the field checked_out_time should have the value 0000-00-00 00:00:00, the default value setup in the element

Thanks Hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top