...

View Full Version : Storing The Date into a Var From a Popup Date Picker



jason_kelly
03-22-2012, 01:28 AM
Hello,

I really need your help with one.

How can I use the following code below to save the date from my popup window datepicker back into a var and relay it back onto its parent page?

I can't seem to figure this out:



<html>



<head>

<script>

function open_cal() {


var str_html = ""
+ "<!DOCTYPE html>\n"
+ "<html lang=\"en\">\n"
+ "<head>\n"
+ "<meta charset=\"utf-8\">\n"
+ "<title>CALENDAR</title>\n"
+ "<link href=\"jq/jquery-ui.css\" rel=\"stylesheet\" type=\"text/css\">\n"
+ "<script src=\"jq/jquery.min.js\" type=\"text/javascript\"></" + "script>\n"
+ "<script src=\"jq/jquery-ui.min.js\" type=\"text/javascript\"></" + "script>\n"
+ "<script src=\"jq/datepicker.js\" type=\"text/javascript\"></" + "script>\n"
+ "</head>\n"
+ "<body>\n"
+ "<div id=\"text\" style=\"font: bold 10pt Tahoma\">Enter Approval Date:</div>\n"
+ "<div id=\"datepicker\"></div>\n"
+ "</body>\n"
+ "</html>"

var j = window.open("","CALENDAR","width=200,height=250,status=no,resizable=yes,top=200,left=200")
j.opener = self;
j.document.write(str_html);
}


</script>



</head>

<body>

<input onclick="open_cal()" type="button" value="Open" name="B1">


</body>

</html>


Datepicker.js:


$(function() {

$( "#datepicker" ).datepicker({

dateFormat: 'dd/mm/yy',

onSelect: function(dateText, inst) {
alert(dateText)
window.close()

}

})




});


Any help with this is greatly and mostly appreciated.

Thanks in advance,

Cheers,

J



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum