Please help on the multiple textbox as date in mysql

<input type="text" name="date" class="f_input input1" style="width:32px;" value="D" maxlength="1" onBlur="if(this.value=='') this.value='D'" onFocus="if(this.value =='D' ) this.value=''"  >
<input type="text" name="date" class="f_input input1" style="width:32px;" maxlength="1" value="D" onBlur="if(this.value=='') this.value='D'" onFocus="if(this.value =='D' ) this.value=''"   >

<input type="text" name="date" class="f_input input1" style="width:32px;" maxlength="1" value="M" onBlur="if(this.value=='') this.value='M'" onFocus="if(this.value =='M' ) this.value=''"  >
<input type="text" name="date" class="f_input input1" style="width:32px;" maxlength="1" value="M" onBlur="if(this.value=='') this.value='M'" onFocus="if(this.value =='M' ) this.value=''">

<input type="text" name="date" class="f_input input1" style="width:32px;" maxlength="1" value="Y" onBlur="if(this.value=='') this.value='Y'" onFocus="if(this.value =='Y' ) this.value=''">
<input type="text" name="date" class="f_input input1" style="width:32px;" maxlength="1"  value="Y" onBlur="if(this.value=='') this.value='Y'" onFocus="if(this.value =='Y' ) this.value=''">
<input type="text" name="date" class="f_input input1" style="width:32px;" maxlength="1" value="Y" onBlur="if(this.value=='') this.value='Y'" onFocus="if(this.value =='Y' ) this.value=''">
<input type="text" name="date" class="f_input input1" style="width:32px;" maxlength="1" value="Y" onBlur="if(this.value=='') this.value='Y'" onFocus="if(this.value =='Y' ) this.value=''">

how to store this in database as (dd/mm/yyyy) format

I think this is not good way of entering date
check jqueryui datepicker its very simple to use, in your case how you will validate date

any way for your case
you must give name and ids to all elements like

<input ....  name='d1' id='d1' >
<input ....  name='d2' id='d2' >
<input ....  name='m1' id='m1' >
<input ....  name='m2' id='m2' >
<input ....  name='y1' id='y1' >
<input ....  name='y2' id='y2' >
<input ....  name='y3' id='y3' >
<input ....  name='y4' id='y4' >

when it is submitted to php process page it must build date there

<?php
$dateval=$_POST['y1'].$_POST['y2'].$_POST['y3'].$_POST['y4']."-".$_POST['m1'].$_POST['m2']."-".$_POST['d1'].$_POST['d2']

$insertquery="insert into table (mydate) values ($dateval)";

?>

I think this is not good way of entering date
check jqueryui datepicker its very simple to use, in your case how you will validate date

any way for your case
you must give name and ids to all elements like

<input ....  name='d1' id='d1' >
<input ....  name='d2' id='d2' >
<input ....  name='m1' id='m1' >
<input ....  name='m2' id='m2' >
<input ....  name='y1' id='y1' >
<input ....  name='y2' id='y2' >
<input ....  name='y3' id='y3' >
<input ....  name='y4' id='y4' >

when it is submitted to php process page it must build date there

<?php
$dateval=$_POST['y1'].$_POST['y2'].$_POST['y3'].$_POST['y4']."-".$_POST['m1'].$_POST['m2']."-".$_POST['d1'].$_POST['d2']

$insertquery="insert into table (mydate) values ($dateval)";

?>

in this only last four character itself inserting I mean only 'yyyy'

I could not insert partial date if you mysql datatype is date.

Post your code what you have done so far after my suggestion.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.