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

Duplicate GET param in forms #5782

Closed
gephaest opened this issue Oct 27, 2014 · 2 comments
Closed

Duplicate GET param in forms #5782

gephaest opened this issue Oct 27, 2014 · 2 comments

Comments

@gephaest
Copy link
Contributor

I have form (in widget view):

<?= Html::beginForm('', 'GET', ['id' => 'header-search']); ?>
<?= Html::textInput('search', ''); ?>
<?= Html::submitButton(Yii::t('ui', 'Search')); ?>
<?= Html::endForm(); ?>

If i click on Search button few times GET parameter duplicating:
image

With ActiveForm same situation

@cebe
Copy link
Member

cebe commented Oct 27, 2014

You have to configure the form action explicitly, it is default to the current request URL so it includes all the params already that were sent by the previous form submit. Set it to be the plain URL without params explicitly.

@cebe cebe closed this as completed Oct 27, 2014
@gephaest
Copy link
Contributor Author

Thanks

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

2 participants