Questions tagged [jquery-trigger]

JQuery Method that Triggers all events bound to the selected elements

Execute all handlers attached to an element for an event without performing the default action of the browser, the transfer event or live events.

This method behaves like the trigger, but there are two major differences:

  • First, doesn't not call the default action of the browser, called event is not reported and live events are also not called.

  • Second, the event is only the first element in the collection jQuery. This method returns an object caused by the handler, jQuery. Also, if the jQuery collection is empty, it returns undefined.

42 questions
1
vote
1 answer

Manually set combobox's value doesnt work before triggering change event

I'm at loss on how to manually update the combobox's selected value, before executing JQuery trigger "change" event for it to pick up the saved selected value. No matter what I do, the saved selected value in change event is blank. I'm using saved…
fletchsod
  • 3,560
  • 7
  • 39
  • 65
1
vote
1 answer

jQuery trigger reset button click

I need to reset radio buttons and checkboxes within a form via code when needed. I am using an indirect approach, where I have placed a reset button and hidden it using CSS.
RandomUser
  • 1,843
  • 8
  • 33
  • 65
1
vote
1 answer

Yii, jQuery: can I make jQuery code generated by ajaxLink() load before other scripts?

I'm making tabbed content in Yii manually, so the content would load data from AJAX. I'm using ajaxLink() and it works fine. The selected tab ID is stored in session so when I reload the page, the same tab is selected again. The problem is, the…
tuks
  • 800
  • 3
  • 11
  • 27
1
vote
2 answers

jquery triggering not working in firefox extension

Steps to reproduce: i created a hai.html and using pagemod i injected scripts into that, here is the code and that hai.html https://github.com/suneeshtr/trigger-test.git Actual results: injection of scripts and everything works fine except…
Suneesh
  • 245
  • 1
  • 4
  • 17
1
vote
3 answers

Simulate javascript to choose from dropdown

I am trying to simulate a javascript to choose from the dropdown list below. I am trying this code here but its not working. $('select[name="srctype"]').val(2).trigger('change'); Am i doing something wrong here? Is my javascript messed up for this…
soniccool
  • 5,790
  • 22
  • 60
  • 98
1
vote
0 answers

jQuery Trigger Event Inline

I have created a couple of custom events, "check" and "uncheck". I can easily use jQuery to implement these like this: $("input:checkbox,input:radio").on("click",function(){ if (j$(this).is(":checked")) { j$(this).trigger({ type:…
Samuel Reid
  • 1,756
  • 12
  • 22
1
vote
1 answer

jQuery stacking and unstacking triggers

The following code works. It allows you to press the enter and escape buttons. Here is a jsFiddle $(document).on('keydown', function(e){ if (e.which == 13){ // Enter Key pressed } }); $(document).on('keydown', function(e){ if…
Jacob Valenta
  • 6,659
  • 8
  • 31
  • 42
0
votes
0 answers

JQuery trigger click does not return target id

I have the following jquery code to trigger a click event: $(document).on('click','#button1, #button2',function(e){ console.log(e.target.id); if (e.target.id == 'button1') { $( "#widgetA .closeresults" ).trigger( "click" ); …
adam78
  • 9,668
  • 24
  • 96
  • 207
0
votes
1 answer

How do I simulate jquery events to trigger Google Autocomplete?

I want to use jquery to programmatically enter a word or phrase and then trigger the Google search box autocomplete suggestions from my console. Here is what I have tried so far: // Inject JQuery into page from console var script =…
Joseph U.
  • 4,457
  • 10
  • 41
  • 47
0
votes
2 answers

Why is .trigger() not working when a selector is added to .on()?

I have an html web page that uses .load() to dynamically add a header. I am also using firebase Auth for authentication which uses .onAuthStateChanged() to identify if a user is signed in or not. There are elements in both the main html document and…
0
votes
3 answers

jquery .click() does not work

on my php page I want to click a button on page load. I have tested it with jQuery and JS. While jQuery does not work, the JS works fine. Any idea why this is the case? jQuery: