This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

slave2anubis
slave2anubis

Hi, Currently i am building a plugin and on one form i have a dropdown with the name "Brand" that updates the options available on a different dropdown. The problem is when i save the form, i get a SQL error that the "brand" column is not found in the table... Is there a way to remove the "brand" filed from the post? I am using de default FormController!

Pavel Chernov
Pavel Chernov

From docs: https://octobercms.com/docs/backend/forms#prevent-field-submission

just add an underscore (_) before the name of the field in the form configuration file. Form fields beginning with an underscore are purged automatically and no longer saved to the model.

slave2anubis
slave2anubis

Solved! Thank you.

slave2anubis
slave2anubis

On the same subject... After you save the model, how do you go around displaying the selected value? The first dropdown gets populated with all the "brands" in the database, but since i dont save the brand_id on my model the correct selected option is not set. The relation is Brand->DeviceModel->Ticket Is there a way to set the selected property in the list of options?

roulendz
roulendz

Pavel Chernov said:

From docs: https://octobercms.com/docs/backend/forms#prevent-field-submission

just add an underscore (_) before the name of the field in the form configuration file. Form fields beginning with an underscore are purged automatically and no longer saved to the model.

Thanks, but is there a way to acces those fields in Model, I want to concatenate 2 fields in one and than that new field save in DB model. Is it possible?

1-5 of 5

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.