CodeIgniter Forums
User Inputted Date Query - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: User Inputted Date Query (/showthread.php?tid=2777)



User Inputted Date Query - El Forum - 08-23-2007

[eluser]LifeSteala[/eluser]
Hi, I have a form which has a field -> "Due Date". I have a javascript widget which let's user's select a date, and whatever they select goes into it's input field like so: "28/8/2007". I have a MySQL table with a DATETIME field. How do I insert this?? I've searched forums, and have had no luck.

Thanks


User Inputted Date Query - El Forum - 08-23-2007

[eluser]Derek Allard[/eluser]
Here's how I do it in BambooInvoice. I have a hidden field, and in the "selection javascript" I use it to change that field's value. Go in and play with the demo, and I think you'll see what I mean.

Obviously, its something that requires some JS know-how.


User Inputted Date Query - El Forum - 08-23-2007

[eluser]LifeSteala[/eluser]
Sorry, I should have elaborated it abit more. When I say how do I insert this, I mean how do I take the value "28/8/2007" from the input box and insert it into MySQL database with a field that is DATETIME..

I have the JS working and all, I can select dates and all. Just not sure how to insert this in the table...

Hope that makes sense.

I appreciate your reply.


User Inputted Date Query - El Forum - 08-23-2007

[eluser]Derek Allard[/eluser]
Why don't you just edit the js to pass the information the way you're expecting?

Barring that, I think you'll need to str_replace or explode the string, so that you could reformat it.