Untitled

mail@pastecode.io avatar
unknown
php
7 months ago
1.2 kB
3
Indexable
Never
                                <input type="text" class="form-control form-control-solid w-md-250px w-sm-100 ps-12" name="searchVersion" value="<?= $searchValue ?>"
                                       placeholder="<?= Yii::t('app/common', 'Search') ?>">
                                <script>
                                    $(function () {
                                        $(`input[name='searchVersion']`).on(`change`, function () {
                                            const searchParams = new URLSearchParams(window.location.search);
                                            searchParams.set(`searchVersion`, $(this).val())
                                            let newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + '?' + searchParams.toString() + window.location.hash;
                                            window.history.pushState({path: newurl}, '', newurl);
                                            $.pjax.reload({container: `#versionIndexPjax`, async: false})
                                        })
                                    })
                                </script>