Questions tagged [jquery]
The jquery tag has no usage guidance.
26
questions
1
vote
1
answer
29
views
Saving custom fields of user with Ajax request
I am using an Ajax (POST) request to update the current user profile.
So far I can successfully update the user fields (like fullName) but I cannot seem to update custom fields.
I have tried adding ...
1
vote
1
answer
705
views
How can I make make the class of an entry link "active" if entry is the current url?
I'm currently using the below jQuery but it's buggy as it relies on looking for 'similar' URL and not the exact URL.
Is there a way it can be done just using Twig?
{% set mainNavigation = craft....
1
vote
2
answers
332
views
Creating a custom, "multiple dates picker" field
We're migrating* a website that uses http://dubrox.github.io/Multiple-Dates-Picker-for-jQuery-UI/ to store any combination of dates for an entry... (eg not just a single date or date range, can be ...
-1
votes
2
answers
304
views
Multiple jQuery $.ajax() calls from one template
I would like to make multiple Ajax calls from my index.html.
One call comes from $(document).ready() function.
Second one is invoked from .on("click") event outside the $(document).ready() ...
2
votes
1
answer
1k
views
Dynamically populating select input fields using jquery $.load and twig template
EDIT: the below code now works!
I have two select inputs, the choice of 1 should populate the second. I have an external twig file (data.twig) (MAKE SURE TO PUT THIS IN YOUR TEMPLATES FOLDER) that ...
0
votes
0
answers
236
views
Search for category and title in Element API for Jquery Autocomplete
I'm working on the search Autocomplete based on this article,
http://craftsnippets.com/articles/search-autocomplete-component-for-craft-cms
Besides the title, I want to search within the category too....
1
vote
1
answer
451
views
Filter Search Craft 3
Does anyone know or have a solution for a live search filter on the frontend for Craft. I can muscle through putting something together but if you have used something that is friendly enough, would ...
1
vote
1
answer
5k
views
Twig variables wont work in an include js file?
Im trying to put my code in a included theme.js file. It wont recognize my variables anymore.
Working in .rain file within the html code:
<script>
jQuery(document).ready(function(){
var ...
1
vote
1
answer
120
views
Ajax - How to create a Category through actionTrigger
I'm trying to create a jQuery/Ajax script to import data from a Wordpress API service and want to import the WP categories and tags into my database. I've managed to import the tags using an Ajax call ...
1
vote
1
answer
89
views
Ajax - Create tag with custom ID programatically
I'm trying to create an jQuery/Ajax script to import data from a Wordpress API service and want to import the WP tags into my database.
Everything works as expected when I loop through the data and ...
2
votes
1
answer
80
views
jQuery Validate with Charge plugin
I'm trying to validate my form before the charge.js is triggered.
I've decided to drop submit button in favour of a standard button and then use valid() method to process submit, so this is what I ...
0
votes
0
answers
156
views
Freeform - jquery lookup to fill in addresses?
Looking for a plugin/script to autocomplete addresses in a form.
I've got a couple of Freeform forms that ask for name, address, and a bunch of other data.
And, I'd like it so that when a user ...
2
votes
1
answer
1k
views
JQuery $.ajax ":success" form logic with Plugin Controller?
I'm working on a simple plugin to facilitate front-end, anonymous lead generation forms submitted to Salesforce via cURL to it's Web-to-Lead servlet. The logic and data transfer are working (debug ...
1
vote
1
answer
1k
views
Simple AJAX search form
So I've been following the docs on how to create a search form in Craft and it works fine. But instead of having a results.twig page I would like to have just one index page and get all the results ...
1
vote
1
answer
1k
views
Error 404 When trying to POST to plugin Controller action
Before I dive into my problem, I do want to mention that I did do my due diligence and spent the last two days researching this problem, to no avail, so here it goes:
So I'm getting the following ...
1
vote
0
answers
64
views
Sprout Forms -- Assign email selects LABEL to hidden field (jquery?)
I have a form that uses an email select form, where the label of each option is a department, and the value is the email or emails associated with that department.
It's working fine, but the ...
1
vote
0
answers
28
views
Add jplist script to Craft CMS
I found this useful search, sort and filter script http://jplist.com, which I have added to my website. It works perfectly until I realize that when my database grow to the point it slow the page down....
0
votes
1
answer
149
views
Uploading local asset hangs and produces jQuery console error
So I have created an Assets field and am using it in one of my Entries. However, when I try to upload an image, it just keeps loading. I am getting the following console error:
Any ideas why? Thanks!
2
votes
1
answer
1k
views
Complete working example for adding Craft Commerce items to the cart using AJAX and jQuery?
I'm using Craft Commerce and every time I click the Add to Cart button for a product, I'm redirected to the Cart page. This works okay, but I'd like to use AJAX (with jQuery v1.12.4) for this to save ...
0
votes
1
answer
178
views
Commerce - Ajax returning obj.success even when failed
I've got a basic jQuery script that I use to update the cart, either through the actions /actions/commerce/cart/updateCart (if product isn't in cart yet) or /actions/commerce/cart/updateLineItem (if ...
3
votes
2
answers
2k
views
What is the correct way to include jQuery and jQuery UI in Craft?
I am wondering what is the correct way to include jQuery and jQuery UI in Craft?
Thank you.
2
votes
3
answers
35k
views
Can I set a JS variable to a Twig output tag?
This came out of a previous question
I need to set a variable of a tag group that I can reference in jquery for use with a plugin.
I'm declaring this variable in a tag so my included js files can ...
3
votes
1
answer
421
views
Load correct language Ajax
I'm having a problem with my ajax-loading when I'm on the english version of my page (My main language is Norwegian). I have a file named loadmore.html that I'm loading in on index.html when pressing ...
1
vote
1
answer
1k
views
Javascript loads before iframes
I have a couple of youtube iframes loaded into a channel entry. I also have a script running that resizes those iframes. It appears the script fires on window load but it appears that it fires before ...
0
votes
1
answer
150
views
Date picker broken? [closed]
I just tried adding a date field to the bone stock Craft news template to try out the Live Preview and I'm getting a jQuery error:
TypeError: undefined is not an object (evaluating 'a.currentDay=e("...
1
vote
1
answer
718
views
How reference "Craft" js object in jquery scope
I have this function within my <script> tags:
$('.btn').click(function()
{
var data = {
title: "This is a title"
};
Craft.postActionRequest('plugin/controller/action', data,...