JQuery datepicker does not respond to click event of after clearing the textbox - jquery-ui-datepicker

I have tried rahul's code. It looks like this
$("input:text.inputTypeDate").datepicker({
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true
});
});
ASP
<asp:TextBox ID="txtDt" runat="server" Width="120px" class="inputTypeDate">
</asp:TextBox>
It works fine on page load, but when I clear the textbox, it stops working.

Related

Ember 2.8: Test that a ember-bootstrap modal is open on page load

Since I'm not working with pure Bootstrap modals, I've been having trouble figuring out how to unit test for a modal that opens on page load. Here's the modal in question:
{{#bs-modal class="startModal" footer=false open=openModal title="Start Game" closedAction="closeModal" backdropClose=false closeButton=false}}
//modal content
{{/bs-modal}}
I tried adding a startModal class in hopes of somehow capturing it with find on my unit test
game-test.js
test('Initial modal shows up', function(assert) {
visit('/');
andThen(function () {
assert.equal(find('.startModal').length, 1);
});
});
This test passes, but it's not really what I'm looking for. I need to assert that the modal is actually shown and not just present.
Why don't you check for a class appended on the modal or css property change:
test('Initial modal shows up', function(assert) {
visit('/');
andThen(function () {
assert.equal(find('.startModal').hasClass('opened'), true);
// or
// assert.equal(find('.startModal').css('display'), 'block');
});
});

JQUERY datepicker calendar, how can I rename the “today” button to “present”

I want to change "Today" button text in Jquery datepicker to "Present".
and also customise the functionality
Any thoughts please
Answer from the comment. It may be helpful to some people
currentText: "Present"
code example:
$('.date-picker').datepicker({
changeMonth: true,
changeYear: true,
showButtonPanel: true,
currentText: 'present',
closeText : 'Close',
dateFormat: 'MM yy',
});

Tooltip added by DOM manipulation is unable to render HTML

I am attempting to render the HTML in a tooltip, but unfortunately its not working at all.
This is how it has been programmed:
<div class="someField"></div>
<script>
$(function () {
$('.someField').append('(Example)');
$("body").tooltip({html:true,selector: '[data-toggle=tooltip]'});
});
</script>
I have set data-html="true" in the link and furthermore enabled html in the tooltip parameter.
Whats wrong with my code?
UPDATE:
Bootstrap v2.3.1 is used for this project (old framework).
Try this:
$("body").tooltip({ html: true, selector: '[data-toggle="tooltip"]' });
WORKING DEMO

jquery dialog is sending multiple requests to the server in chrome and firefox

I am using jquery 1.4.2 version and jquery 1.8 ui version. with this when i am opening jquery dialog box in case of IE8, it is working fine and sending only 1 request. but when i tried this with chrome and firefox or IE10, it is sending multiple request to the server. kindly help on this.
below is the code Details:-
document.getElementById("hyperLinksFrame").src = fileName;
$('#hyperLinksFrame').dialog({
title :'Link',
autoOpen: true,
width: 500,
height: 200,
modal: true,
resizable: true,
autoResize: true,
dialogClass: "ent_blue_iframe",
buttons:{"Close": function(){
$(this).dialog('close');
}},
close: function(ev, ui) {
document.getElementById("hyperLinksFrame").src = "";
document.CICoverPageForm.userAction.value = 'addLinksOnCoverPage';
ajaxSubmit();
$(this).dialog ('destroy');
}
}).width(500).height(200);
<div id="parentHyperLinkDiv" style="display: none;">
<iframe src="" id="hyperLinksFrame"> </iframe>
</div>

Setting the year range for jQuery datepicker

I am using jQuery datepicker, and I want to set the year range. This is my code:
$( "#birthday" ).datepicker({
changeMonth: true,
changeYear: true,
yearRange: "-100:-10"
});
It loads and becomes unresponsive until both year and month drop down items are selected. What am I doing wrong in above code?