Welcome Guest, Not a member yet? Register   Sign In
Input date
#1

Hello,

I am trying to create an input form for date how to do so?

I prefer using animative date like you just need to click the date number and choose the year in order to input the date.  How to do so ?


PHP Code:
<html>

<
title>Blog Form</title>

<
br>

<
h1>BLOG FORM</h1>


<?
php $this->load->helper('form'); ?> 

<?php echo validation_errors(); ?>

<?php echo form_open('form'); ?>


<table>

<tr>
<td>Date  :</td>
<td><input type="text" name="username" value="" size="50" /></td>
</tr>
<tr>
<td>Upload  :<br><br></td>
<td><input type="text" name="username" value="" size="50" /></td>
</tr>
<tr>
<td>Title :</td>
<td><input type="text" name="username" value="" size="50" /></td>
</tr>
<tr>
<td>Content :</td>
<td>
<textarea rows="8" cols="50">

</textarea>
</td>
</tr>

<div><input type="submit" value="Submit" /></div>

</form>
</table>


</html> 
" If I looks more intelligence please increase my reputation."
Reply
#2

PHP Code:
$today date("F j, Y, g:i a");                 // March 10, 2001, 5:16 pm
$today date("m.d.y");                         // 03.10.01
$today date("j, n, Y");                       // 10, 3, 2001
$today date("Ymd");                           // 20010310
$today date('h-i-s, j-m-y, it is w Day');     // 05-16-18, 10-03-01, 1631 1618 6 Satpm01
$today date('\i\t \i\s \t\h\e jS \d\a\y.');   // it is the 10th day.
$today date("D M j G:i:s T Y");               // Sat Mar 10 17:16:18 MST 2001
$today date('H:m:s \m \i\s\ \m\o\n\t\h');     // 17:03:18 m is month
$today date("H:i:s");                         // 17:16:18
$today date("Y-m-d H:i:s");                   // 2001-03-10 17:16:18 (the MySQL DATETIME format) 
Just add it to your database date field.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

You can use a date input, but support is browser-dependent (see http://html5doctor.com/the-woes-of-date-input/ ).

The alternative is to use a JavaScript plugin to generate the datepicker. An older article on doing this (which also covers using the plugin as a fallback if the native datepicker is not supported) can be found here: https://www.tjvantoll.com/2012/06/30/cre...jquery-ui/
Reply




Theme © iAndrew 2016 - Forum software by © MyBB