Hi,
I am using your fantastic module for my new application but I encountered a problem with forms.
I figured it is working perfectly for forms with POST method, but when I try to use GET form, the form submits without appending the fields to the query string. The form in specific is a search form, with a singular field named s. I checked the web inspector and the module is making a successful GET request to the URL in action but it is not appending the query string.
Cheers,
Luca
Hi,
I am using your fantastic module for my new application but I encountered a problem with forms.
I figured it is working perfectly for forms with POST method, but when I try to use GET form, the form submits without appending the fields to the query string. The form in specific is a search form, with a singular field named **s**. I checked the web inspector and the module is making a successful GET request to the URL in **action** but it is not appending the query string.
Cheers,
Luca
If there is anything else needed just ask. I tried removing the Pjax snippet, and the form works just fine, append the query string to the URL as supposed to do. The HTML section of the code is inside the selector main, indeed Pjax works as it correctly submits the form using GET as method, but as said above it does not append the query string to the URL.
Thank you for your answer, apparently JSFiddle does not accept forms with GET request. I will just write my code down here.
JS/Webpack
var Pjax = require('pjax')
var pjax = new Pjax({
selectors: ["title", "main", "#header-nav"],
cacheBust: false
})
HTML/Blade (Laravel)
<form action="{{ route("panel.sellers.home") }}" method="get">
<div class="row">
<div class="input-group mb-3 col-sm-6">
<input type="text" name="s" value="{{ Request::query("s") }}" class="form-control" placeholder="Name, email address, ID...">
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="submit">
<i class="fa fa-fw fa-search"></i>
</button>
</div>
</div>
</div>
</form>
If there is anything else needed just ask. I tried removing the Pjax snippet, and the form works just fine, append the query string to the URL as supposed to do. The HTML section of the code is inside the selector **main**, indeed Pjax works as it correctly submits the form using GET as method, but as said above it does not append the query string to the URL.
Thanks @Sevenarth, you are quite right that Pjax wasn't appending the query string to the URL when submitting GET forms. This should be fixed in #129 now.
If you have time, perhaps you could check out the branch and test this for me?
Thanks @Sevenarth, you are quite right that Pjax wasn't appending the query string to the URL when submitting GET forms. This should be fixed in #129 now.
If you have time, perhaps you could check out the branch and test this for me?
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Hi,
I am using your fantastic module for my new application but I encountered a problem with forms.
I figured it is working perfectly for forms with POST method, but when I try to use GET form, the form submits without appending the fields to the query string. The form in specific is a search form, with a singular field named s. I checked the web inspector and the module is making a successful GET request to the URL in action but it is not appending the query string.
Cheers,
Luca
Can you post your code or ideally make a reduced test case using JSFiddle that demonstrates the issue?
Thank you for your answer, apparently JSFiddle does not accept forms with GET request. I will just write my code down here.
JS/Webpack
HTML/Blade (Laravel)
If there is anything else needed just ask. I tried removing the Pjax snippet, and the form works just fine, append the query string to the URL as supposed to do. The HTML section of the code is inside the selector main, indeed Pjax works as it correctly submits the form using GET as method, but as said above it does not append the query string to the URL.
Thanks @Sevenarth, you are quite right that Pjax wasn't appending the query string to the URL when submitting GET forms. This should be fixed in #129 now.
If you have time, perhaps you could check out the branch and test this for me?
Fixed in #129