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

search.js interferes with form validation #194

Closed
63ba1f46da opened this issue Mar 11, 2016 · 4 comments
Closed

search.js interferes with form validation #194

63ba1f46da opened this issue Mar 11, 2016 · 4 comments

Comments

@63ba1f46da
Copy link

Including search.js in every page by compressing it with other js files in the scripts.min.js file leads to this problem.

    $(document).on("submit", $searchForm, function(e) {
        e.preventDefault();
        q = $searchInput.val();
        execSearch(q);
    });

somehow every time any other form gets submitted this script fires and the form refuses to post although the validation take place just fine. Consider removing this file from script.min.js and placing it only in the search page.

@pstavirs
Copy link

I also have the same problem.

Any plans for a fix?

@annegentle
Copy link
Contributor

I have this problem as well.

@annegentle
Copy link
Contributor

I found the fix in this PR on the original jekyll-search repository:

$searchForm = "[data-search-form]",

See https://github.com/mathaywarduk/jekyll-search/pull/13/files for more details.

mmistakes added a commit that referenced this issue Sep 11, 2016
@mmistakes
Copy link
Owner

Thanks for the detective work @annegentle.

I've pushed this fix if someone wants to verify that it clears up the problem before I merge it into master. Should just have to overwrite your copy of scripts.min.js with this one.

mmistakes added a commit that referenced this issue Sep 12, 2016
jessestuart added a commit to jessestuart/jessestuart.com-archived that referenced this issue Apr 11, 2017
* mmistakes/master: (102 commits)
  Improve readability of .scss files
  Change `spin` to `adjust-hue` - Close mmistakes#201
  Update modified date
  Update gems
  removing parentheses, see issue mmistakes#141
  Fix search.js interferace with other forms - cc/ issue mmistakes#194
  Remove Octopress configuration
  Update README
  Remove feed.xml and replace with jekyll-feed gem
  Replace {% highlight %} Jekyll tags with GFM ```
  Remove Octopress dependency
  Update gems
  removed pro tip on applying for twitter cards
  Ignore .less files not files containing "less"
  Sanitize excerpts in search.json - Fixes mmistakes#191
  Normalize auto {{ post.excerpts }} - When excerpt: isn't set in a
post's YAML Front Matter fallback to Jekyll's auto excerpts - Strip
HTML from auto excerpts and MathJax code with Liquid filters applied to
post listings (index.html, /blog/, /articles/)
  Support Jekyll 3.0 - Update to Jekyll v3.0 - Switch from Pygments.rb
to Rouge for syntax highlighting - Include jekyll-gist gem - Update
theme documentation
  Fix typo in `bundle exec`
  Update dependencies
  Update links - Remove Made Mistakes from header nav - Update So
Simple footer link
  ...

# Conflicts:
#	_config.yml
#	_data/authors.yml
#	_data/navigation.yml
#	_includes/footer.html
#	_layouts/page.html
#	_layouts/post.html
#	_posts/articles/2011-03-10-sample-post.md
#	_posts/articles/2012-05-22-readability-post.md
#	_posts/articles/2013-05-22-sample-post-images.md
#	_posts/articles/2013-05-23-readability-feature-post.md
#	_posts/articles/2013-06-25-video-post.md
#	_posts/articles/2013-08-16-code-highlighting-post.md
#	_posts/articles/2014-06-19-author-override.md
#	_posts/blog/2014-08-08-hello-world.md
#	about/index.md
#	feed.xml
#	images/michael-rose-photo.jpg
#	images/so-simple-sample-image-1.jpg
#	images/so-simple-sample-image-2.jpg
#	images/so-simple-sample-image-3.jpg
#	images/so-simple-sample-image-4.jpg
#	images/so-simple-sample-image-5.jpg
#	images/so-simple-sample-image-6.jpg
#	images/so-simple-sample-image-7.jpg
#	theme-setup/index.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants