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

gohhan
gohhan

My records:

{% for record in records %}

<h5 class="modal-title w-100">{{ record.title }}</h5>
<img src="{{ record.photo|media }}" class="img-fluid" alt="{{ record.title }}">

{{ record.description | raw }}

{% component 'PortfolioForm' %}

{% endfor %}

My template form:

<form data-request="{{ __SELF__ }}::onFormSubmit">
    {{ form_token() }}
    <input type="hidden" name="image" value="{{ record.photo|app }}">
</form>

I need to transfer the variable to the hidden field to make the notification. In my case, the hidden field is empty

upd: Can Magic Forms work in a loop? In my example above, I'm putting out a lot of blocks with a form that needs to be handled independently.

Last updated

mjauvin
mjauvin

hidden fields values are not sent to the AJAX handlers.

gohhan
gohhan

mjauvin said:

hidden fields values are not sent to the AJAX handlers.

Thank you! How can I solve the problem? If I make the fields visible, but hide with CSS, will it work?

gohhan
gohhan

gohhan said:

mjauvin said:

hidden fields values are not sent to the AJAX handlers.

Thank you! How can I solve the problem? If I make the fields visible, but hide with CSS, will it work?

<input name="recordtitle" value="{{ record.title }}">
<input name="recordmainimage" value="{{ record.mainimage.path }}">

That's not how it works. :( I took the variable out of the field, took the variable out of the form tag - the variable value is not transmitted.

Last updated

1-4 of 4

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