Note that there are some explanatory texts on larger screens.

plurals
  1. POSending a change event from a jquery datepicker inside an asp.net user control?
    primarykey
    data
    text
    <p>I have a jquery datepicker inside an asp.net user control.</p> <p>I need to set up a change indicator (it doesn't have to be onchange, any event name will do, so long as I can reference it from the .aspx of the page containing the control to do javascript specific to that control on that page when a new date is selected on the calendar.)</p> <p>This is the javascript to initialize my datepicker.</p> <pre><code> calendarcontrol.datepicker({ altField: calendarcontroldate, navigationAsDateFormat: true, onSelect: function(dateText, inst) { alert(dateText); }, nextText: 'MM', prevText: 'MM' }); </code></pre> <p>The datepicker initializes fine, and the alert does pop up on date select as expected when it is set up like above, but when I tried sending it up to the page by passing it through control parameters, or by calling the page's javascript function directly, it didn't fire at all. </p> <p>What do I need to do to set up a control event for the internal calendar select, so that my page can catch it and do further javascript when necessary? I have the control working beautifully, the final thing I need is to have an event show up on the page when a new date is selected in the user control.</p> <p>Much thanks. I'm getting better, but jquery is still pretty mysterious to me.</p> <p>EDIT: ok, got it working like this:</p> <pre><code> // init main datepicker calendarcontrol.datepicker({ altField: calendarcontroldate, navigationAsDateFormat: true, onSelect: window[hfSelectDate], nextText: 'MM', prevText: 'MM' }); </code></pre> <p>where hfSelectDate is a passed-in string for the function (I set it through the parameters so I can just use it in the aspx.)</p> <p>Thanks for pointing me in the right direction!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload