Questions tagged [javascript]

For questions related to JavaScript in Sitecore, including JS for Sitecore SPEAK applications (typically ReactJS), bugs or other issues with JS in Sitecore, hosting site JS in Sitecore, and beyond

Filter by
Sorted by
Tagged with
2 votes
2 answers
210 views

How to Disable Submit Button After Click in Sitecore Forms?

I'm working with Sitecore 10.1 and facing a challenge with Sitecore forms. I want to disable the submit button right after it's clicked. I've attempted some script solutions but haven't found a ...
Owais Ahmed's user avatar
2 votes
0 answers
54 views

Sitecore Forms onclick of back button clearing data

I have a country field in Sitecore Forms which gets data populated from AJAX call on page load. When I enter all the values in the form and navigation to next page all the fields looks fine. I am ...
Mamtha's user avatar
  • 65
0 votes
1 answer
45 views

Active Mixed Content Vulnerability - http://110005487.collect.igodigital.com/collect.js

We are using Sitecore 9.3. We have a vulnerability reported in Qualys scan - "Active mixed content vulnerability". Threat An active mixed content vulnerability has been discovered while ...
NewbieHere's user avatar
0 votes
0 answers
31 views

Unable to access 'FileProperties' JSON of document uploaded to Content Hub DAM to retrieve file extension

Running Sitecore.NET 10.3.0 - November 01, 2022 .NET Framework 4.8 I'm trying to figure out how to retrieve the FileProperties (JSON values) that contains metadata information regarding files uploaded ...
Noel's user avatar
  • 1
0 votes
0 answers
37 views

Adding custom script path after assetlinks in Sxa layout file

I have a situation where I need to add a custom script path after script paths appearing from assetlinks.Scripts in the Sxa Layout file. Tried using placeholder after for loop, but did not work out ...
Siddhi Kamat's user avatar
2 votes
3 answers
329 views

Sitecore Form references non-existing JQuery version in Sitecore 10.2 during the page load

When loading a page containing a Sitecore form, the console displays exceptions related to the version of JQuery. (Note that the form in question includes validation for some of the fields.) I'm not ...
D Myers's user avatar
  • 21
0 votes
1 answer
143 views

Debug SXA theme

We are running Sitecore 9.1.1 and SXA 1.8.1. We create theme by using npm command (npm run build). This command does bundling, minification and create a zip file. We import that Zip file into the SXA ...
Imad's user avatar
  • 235
2 votes
2 answers
448 views

Sitecore forms required validation is not working for dropdownlist

We have upgraded to Sitecore 10.1 from Sitecore 8.7. In Sitecore forms, dropdownlist required validation is not working. The required validation is working for all simple type fields but not for ...
Owais Ahmed's user avatar
2 votes
1 answer
372 views

Experience Editor current chrome is null, crashes editor when referencing chrome.parent

Having an odd issue in Experience Editor (Sitecore 10.1.2, containers). Intermittently, when adding a new component from the ribbon, EE will not respond and print the following to console: Uncaught ...
eidolonic's user avatar
0 votes
2 answers
106 views

Make Javascript editable in Sitecore SXA CMS?

I am using Rich Text Editor for the template field for script content, I need to make the entire script editable in Sitecore SXA 10. The RTE removes the script content. The script content is as ...
Siddhi Kamat's user avatar
0 votes
1 answer
190 views

Javascript link rendered without onclick attribute in preview

When using javascript link the edit mode renders the target script in onClick attribute <a href="#" onclick="javascript:void(0);onclick=javascript:openOverlay('test-overlay',event);...
nari447's user avatar
  • 407
0 votes
0 answers
182 views

Sitecore 9.3 - parts of CM stopped working, JavaScript errors in console

It seems that any place the Sitecore CM where a modal dialog would pop up has stopped working and I haven't been able to figure out why. I see the same behavior in both Chrome and FireFox. The error ...
nlounds's user avatar
0 votes
0 answers
241 views

Disable submit button after first submission

I want to stop duplicate WFFM form submissions. I am writing a method to disable the button after first submission. $("form").each(function() { var wffm = $(this).attr("data-wffm&...
Owais Ahmed's user avatar
2 votes
1 answer
634 views

How to show success message alert on form submit in Sitecore 9 Forms in the same page?

I am trying to implement a custom Sitecore 9 Forms (not WFFM forms) functionality. And I need to show a success alert message on successful submission of the form. But here's the catch, The success ...
anupam's user avatar
  • 33
1 vote
0 answers
118 views

Undefined Javascript Error on Media Upload

In Sitecore 8.2, we have an item template featuring an image field. The preferred workflow for creating an instance of this template is the use of the Browse trigger on the image field and the Upload ...
Ron Ritchie's user avatar
0 votes
1 answer
604 views

Upgrading jQuery for sitecore xp 9.3

I notice sitecore 9.3 does have a pretty low version of jQuery at several places in the content editor in sitecore/shell/lib/jquery, ScriptResource.axd, Telerik.Web.UI.axd are all using jQuery 1.12.4 ...
meanmean's user avatar
1 vote
1 answer
236 views

Page in Experience Editor hangs forever with page unresponsive dialogs

We are using Sitecore 8.2. We have a page with Marketo Form which contains Google Recaptcha. We lazyload the scripts and styles on the page. In experience editor, once we scroll down to the form, the ...
Ghan's user avatar
  • 655
0 votes
1 answer
692 views

How to correctly import jQuery in SXA?

I could add the library in the theme's script/ folder, but when SXA minifies and uploads the files, it loads my other scripts before it loads the jQuery library (thus breaking the site since it doesn'...
imleaving's user avatar
0 votes
0 answers
89 views

Can I add a script that is dynamically changed in a Sitecore layout page?

My company is still using Sitecore v8.2 and for a while we are not upgrading it. Is there a way to add a script that has been created Front End side using Webpack and that has the following structure &...
Ferie's user avatar
  • 101
0 votes
0 answers
50 views

Is there an easy way to integrate Sitecore v8.2 with a modern JavaScript Framework?

As far as I know, Sitecore v8.2 is not using JSS. My company is still using this version of the CMS and for many reasons, there is a stuck in upgrading it. In any case, we would like to introduce a ...
Ferie's user avatar
  • 101
1 vote
1 answer
834 views

Sitecore Forms JavaScript not working for multi-page form markup

I am creating a Sitecore multipage form using Sitecore Experience Forms, The markup for step/page 2 is only rendered after I click on the next button on page 1. I want to trigger some JavaScript on ...
Pradeep Gupta's user avatar
0 votes
1 answer
158 views

Trigger a Sitecore Command on a Modal link item

I am working on a Dashboard Popup in Sitecore in which I display list of several items. And I want to know if I can trigger a sitecore command link the "item:load" to focus on the Content ...
Jovit Mayo's user avatar
1 vote
1 answer
877 views

Sitecore Form Scripts aren't being Loaded after Form Submission

So, before submitting a form, my web page loaded all the form-related scripts completely. However, after the form is submitted, the page went blank and only displaying the form element, and it got ...
Alen's user avatar
  • 11
1 vote
1 answer
2k views

Inject JavaScript in the header tag of the page based on rendering

We have specific requirement where we want to load only the scripts/css which are required for particular rendering on the page. Those scripts/css need to be loaded in the <head> tag but not in ...
Arun Kumar's user avatar
1 vote
0 answers
295 views

Add Sitecore Form Fields with Javascript

Is it possible to add a sitecore form field to a form with javascript and if so, how should I approach it?
Nick's user avatar
  • 21
1 vote
1 answer
105 views

Angular JSS - References to Window Break In Experience Editor

I have a couple references to the window object in my Angular JSS component: @HostListener('window:resize', ['$event']) onResize(event) { if (window && typeof window !== 'undefined') {...
Liam Smith's user avatar
1 vote
0 answers
84 views

Consume sitecore jss data from a separate sitecore instance

I have a Sitecore 9.1 MVC implementation where I want to consume the layout service response from a different Sitecore endpoint as an rendering. I have gone through the ways mentioned in Sitecore ...
Anandarup's user avatar
1 vote
1 answer
536 views

Trigger Google Analytics Events on Sitecore WFFM form submission

I want to track form submissions by creating a dataLayer event (a JS array with form values) when a form is submitted successfully (onSubmit). This is my sample DataLayer Push code <script> ...
user avatar
0 votes
1 answer
167 views

SXA drop down filters reset button not working

I'm using in one page 3 SXA drop down filters (category, services, activity), search result and a reset button that clears the filters in the bellow script: function forceReset(){ if ($xa(".clear-...
Doaa Abdallah's user avatar
1 vote
0 answers
42 views

Commerce JavaScript Hooks

I am using XP 9.0.2, XC 9.0.3 andSXA 1.8.1, in commerce, are there javascript hooks I could use to display loading animations while activities such as product list loading are taking place? I was ...
smh111976's user avatar
2 votes
1 answer
435 views

Is there a way to write to the Sitecore logs via Javascript? (8.2)

I need to track some particular Javascript events in my Sitecore (8.2) logs so that I can see how often it's firing. I have some ideas for how I could make my own api to write to the Sitecore logs, ...
Erica Stockwell-Alpert's user avatar
6 votes
3 answers
4k views

Sitecore 9.1 Experience editor throwing JS errors

we recently migrated to Sitecore 9.1 from 8.1 and we see a bunch of JS errors on the page only in experience editor mode. I dont see them happening in the normal mode. I tried replacing the Sitecore ...
Night Monger's user avatar
4 votes
1 answer
2k views

Video component YouTube elements are not clickable

On the video component when I input a YouTube video, the share, watch later, video title and up next sections are visible, but are not clickable, is there a solution to this?
Jack Hayward's user avatar
1 vote
0 answers
59 views

Doing translations for javascript based controls

I am using kendo-ui for rendering some complex controls on our website mainly used for data-entry. I want to have the content of these controls being translated by sitecore and also have the controls ...
Wilko van der Veen's user avatar
0 votes
0 answers
240 views

Insert javascript to link not working as expected [duplicate]

Using insert javascript on link field, adds javascript code to a tag in href with return false which is added automatically and because of it mistake appears and if manually delete return false ...
John Vein's user avatar
  • 141
1 vote
1 answer
175 views

Create new user with JSS

Is there any API by which can create a new user in Sitecore with JSS?
Антон Достоевский's user avatar
2 votes
1 answer
280 views

Sitecore datetime to javascript Date object

Say please what is the best way to convert Sitecore datetime string (20170401T073000Z) to javascript Date object ?
Антон Достоевский's user avatar
1 vote
0 answers
2k views

jQuery AJAX GET request returning “parsererror” error response message

In a scope of Sitecore Web project an API Contoller is used. Got the following response error message during jQuery AJAX GET API request: On a back-end side I use IHttpActionResult action method that ...
Vadzim Papko's user avatar
1 vote
2 answers
2k views

How to show a loading image mean while a submit form is being executed in Sitecore 9 Forms

Currently I have a form (created using Sitecore 9 Forms not with WFFM module) and on submit (custom submit action button). While clicking submit button, I have to show the loading image in the client ...
PKH's user avatar
  • 475
0 votes
1 answer
131 views

WFFM custom toggle switch [closed]

I am adding toggle switch as a custom field. Toggle.cs (Toggle C# code) public class Toggle: Sitecore.Form.Web.UI.Controls.Checkbox { } public class ToggleField : Sitecore.Forms.Mvc....
user avatar
-1 votes
3 answers
2k views

jQuery not working properly with Experience Editor

I'm struggling to get jQuery to work properly in Experience Editor. I found this question and tried all the answers on that page, but none of those work for me. So basically I have a clean page in ...
TheHvidsten's user avatar
  • 1,004
4 votes
1 answer
2k views

How to extend SXA components scripts?

I need to overwrite/extend the component JavaScript (e.g.: script for the Carousel which is located here /sitecore/media library/Base Themes/Components Theme/Scripts/component-carousel) files to add ...
Dawid Rutkowski's user avatar
1 vote
2 answers
2k views

loading partial view from jquery

I am trying to swap partial views on my home page layout via jquery. I have 3 tabs which when clicked, would load their respective partial view into a placeholder on the main layout. In my ...
Nick's user avatar
  • 159
5 votes
1 answer
548 views

How do I add some JavaScript at the bottom of every layout using a pipeline?

I'm wanting to add some JavaScript to the bottom of every page, but I don't want to add it to the layout(s), so I'd like a way of doing it with a pipeline (or similar). I've tried a few of the MVC ...
Matt Eno's user avatar
  • 373
4 votes
2 answers
610 views

Whats is the correct way to implement FXM generated script

I'm having a problem implementing FXM generated script on some of out sites. The Issue, I found is that, the generated Tracking script script is located on our CMS, which is not a public domain. I ...
Ryan Jusay's user avatar
2 votes
2 answers
993 views

Sitecore Experience Editor not working with ".slick" command

I am using .slick command on the javascript for my page carousels. When I try to edit items in Sitecore Experience Editor(Sitecore 9 with SXA) my Save button is disabled and I am unable to add any new ...
Amitabh's user avatar
  • 1,066
1 vote
1 answer
1k views

What is the best way to add a Javascript component to speak?

I want to use the jsgrid in a customized sitecore shell model , i wonder what could be the best way to include the script file without building a custom speak component. Thank you
Naim Alkouki's user avatar
1 vote
0 answers
1k views

Configuration error in JSS Sitecore Quick start for development

Configuration error while browsing Sitecore basic jss app after performing deployment steps mentioned in below link: https://jss.sitecore.net/#/setup/app-deployment?id=app-deployment
ashraf bhat's user avatar
4 votes
3 answers
275 views

Why is my Ajax url found when I test in preview mode, but not when I bring up the page in a url I get not found errors

Update: this is what my url is trying to resolve to: /home/about us/api/sitecore/findanaffiliate/getaffiliate/ so here is my Ajax : <script type="text/javascript"> $("#AffiliateList")....
Paul T. Rykiel's user avatar
3 votes
1 answer
104 views

Identify Administrators in Javascript

I am modifying the existing javascript for the SelectRoles modal window, and I would like to add a piece of code to check if the current user has the "Is Administrator" checkbox checked. I need to ...
Colin Leitch's user avatar