Add a jquery datepicker on jquery dialog box via load method
Tech-Today

Add a jquery datepicker on jquery dialog box via load method


Recently I've worked on a form that requires a jquery datepicker to be rendered inside jquery's dialog element. Where I encountered several problems like:
1.) datepicker() should be invoke inside dialog
2.) the dialog created (div) should be remove from the page body


How I load the dialog using jquery's load method:

// Generate a unique id for the dialog div
var dialogId = 'uniqueName-' + Math.floor(Math.random() * 1000)
var dialogDiv = "
";

// Load the form into the dialog div
$(dialogDiv).load(this.href, function () {
$(this).dialog({
modal: true,
resizable: false,
title: dialogTitle,
buttons: {
"Save": function () {
// Manually submit the form
var form = $('form', this);
$(form).submit();
},
"Cancel": function () { $(this).dialog('close'); }
},
open: function (event, ui) {
if ($('input.date-picker').length > 0) {
$('input.date-picker').datepicker({
showOn: "button",
buttonImage: "/Content/images/calendar.gif",
buttonImageOnly: true
});
}
},
close: function (event, ui) {
$('input.hasDatepicker').datepicker("destroy");
$(this).dialog("destroy");
$(this).remove();
}
});




- How To Display A Date With Textfield Click With Swift
Displaying Date with TextField Click with Swift First you must have a textfield connected to storyboard. @IBOutlet weak var txtField_helloDatePicker: UITextField! Next you should have a constant of UIDatePicker type. let datePicker...

- Adding Loading Screen To C# Mvc Ajax Dialog Form Using Jquery
With my experience from telerik, I want my entity's add and edit form to be a popup so I don't have to change screen. I'm using C# MVC3, so I tried to look for jquery add on that would do the job. Fortunately I've come up with this article:...

- Jquery Datepicker Show Only The Month And Year
I have created a report search form that filter the monthly record of sales. So I don't really care about the specific day but the month. Jquery has a nice DatePicker library, but it can't be customized to remove the month part, so just hide it...

- Jquery Copy Form Values Into Another Form
Recently I have a requirement to have two form on a single page. Why? It's because I have a search form that query records from the database with the aid of ajax. Then another form to generate a report based from the filters specified in the first...

- Docmd.close Acform, Frmname Not Working
Playing with the old VB form in MS Access, I have this weird error. I have 2 forms: form1 and form2, when I am in form2 there is a close button there, and when I press that button which has a button click action: DoCmd.Close acForm, form2.Name The...



Tech-Today








.