Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In the loop, the first Editable widget is created without a <form> #223

Open
crocone opened this issue Dec 18, 2024 · 0 comments
Open

In the loop, the first Editable widget is created without a <form> #223

crocone opened this issue Dec 18, 2024 · 0 comments

Comments

@crocone
Copy link

crocone commented Dec 18, 2024

I have a component:
`

['id' => 'productForm']]); ?>

// form fields

$point, 'attribute' => 'reservation', 'formOptions' => [ 'id' => 'update-reservation' . $point->id . $good->id, 'action' => ['/order/' . $point->stock_id . '/update-reservation/' . $good->id],], 'inputType' => Editable::INPUT_HTML5, 'options' => [ 'type' => 'number', 'name' => 'reservation', 'min' => 0, 'disabled' => $model->order_status === Order::STATUS_CONFIRM, 'max' => $point->count, 'class' => 'form-control', 'placeholder' => 'Enter a reservation number', 'id' => 'reservation-' . $good->id . $point->id, ], ]); ?> // other form fields `

The issue: In the loop, the first Editable widget is created without a

wrapper having the ID 'update-reservation' . $point[0]->id . $good[0]->id.

However, the jQuery code for this form is generated:
var $el = jQuery("#update-reservation17117 .kv-hint-special"); if($el.length) { $el.each(function() { $(this).activeFieldHint() }); } jQuery('#update-reservation17117').yiiActiveForm([], []);
If I remove:
<?php ActiveForm::begin(['options' => ['id' => 'productForm']]); ?>
everything works correctly. The issue seems to be that Editable detects an already existing form and does not create a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant