Vous êtes sur la page 1sur 3

9/20/13

datepicker OnSelect / OnClick submit - jQuery Forum


jQuery Plugins UI M eetups Forum Blog About Donate

All Forums

Recent Posts

Log In

JQUERY FORUM

Search jQuery

Using jQuery UI

Statistics
5 Replies 8916 Views 0 Followers

datepicker OnSelect / OnClick submit


in Using jQuery UI 1 year ago New to JQuery, sorry brentaugu.. This seems like the most basic want/need in the world to ask of datepicker, but I cannot find any support addressing how to do it. How do I simply get the datepicker to auto submit/post the date variable when you click a date? IE: Load page Click in date field Datepicker pops up Click on date Form submits and posts variable Page refreshes and (does something) display submitted date variable If someone can show me how to do this in the demos/datepicker/default.html I would be most appreciative! Reply 1

Like

Tags
datepicker submit onselect onclick

Actions
Permalink

Related Posts
Datepicker showing multiple months ... datepicker + time picker? jQuery UI 1.8.13 with jQuery 1.3.2 datepicker autoselects and fires on... Datepicker Positioning

Replies(5)

Re: datepicker OnSelect / OnClick submit


1 year ago

Ok I got it submitting through POST using OnSelect... brentaugu.. HOWEVER... I cannot call the $pickeddate variable... do I need to apply date formatting or something? If so any ideas on how to go about that? Here is the code I am using. test.html <head> <meta charset="utf-8"> <title>jQuery UI Datepicker - Default functionality</title> <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css"> <script src="../../jquery-1.7.2.js"></script> <script src="../../ui/jquery.ui.core.js"></script> <script src="../../ui/jquery.ui.widget.js"></script> <script src="../../ui/jquery.ui.datepicker.js"></script> <link rel="stylesheet" href="../demos.css"> <script type="text/javascript"> $(function() { $('#pickeddate').datepicker({ autoSize: true,

forum.jquery.com/topic/datepicker-onselect-onclick-submit

1/3

9/20/13

datepicker OnSelect / OnClick submit - jQuery Forum


onSelect: function (dateText, inst) { $(this).parent('form').submit(); } }); }); </script> <style> #ui-datepicker-div {} .ui-datepicker-trigger { vertical-align: middle;} </style> </head> <body> <div class="demo"> <form id="frmDate" action="test2.html" method="POST"> <input id="pickeddate" name="pickeddate" type="text" /> </form> </div><!-- End demo --> </body> </html>

test2.html <html> <body> <div class="demo-description"> <p>This is a test DATE FORM.</p> <p>PickedDate Variable :<?php echo $_POST["pickeddate"];?></p> </div><!-- End demo-description --> </body> </html> ... For me to poop on.

Re: datepicker OnSelect / OnClick submit


1 year ago

The code you have shown looks OK. Where is the $pick eddate variable you are having trouble with? kbwood.au

Re: datepicker OnSelect / OnClick submit


1 year ago

I am setting the variable in POST then that last section is actually test2.html where I am trying to brentaugu.. call the $_POST['pickeddate'] ... For me to poop on.

Re: datepicker OnSelect / OnClick submit


1 year ago

As I said, your code looks OK. Can you provide the URL of a page that demonstrates the problem?

forum.jquery.com/topic/datepicker-onselect-onclick-submit

2/3

9/20/13
kbwood.au

datepicker OnSelect / OnClick submit - jQuery Forum

Re: datepicker OnSelect / OnClick submit


7 months ago

Is your test2.html being parsed by PHP? furyde

Top

Reply

2013 jQuery Foundation


Sponsored by and others.

All Forums

Recent Posts

forum.jquery.com/topic/datepicker-onselect-onclick-submit

3/3

Vous aimerez peut-être aussi