How do i submit current date and time in database with a form?

Here is what i am trying ? Kindly help me?

<form class="form-horizontal" method="post" action="" enctype="multipart/form-data">
            <input type="hidden" name="ronel" value="">
<fieldset style="position:relative; width:73.05%; height:50px; border:1px solid gray;">
                        <div class="form-group" style="position:relative; left:80px; top:-8px;">
                            <label style="position:relative; right:80px; top:25px;" for="inputEmail" class="col-lg-3"><b>Location:</b></label>
                            <div class="col-lg-9">
                                <textarea name="location" class="form-control" rows="2" cols="56" maxlength="100" onkeyup="textCounter(this,'counter5',100);"></textarea><input style="position:absolute; left:54%; bottom:0px;" disabled maxlength="3" size="2" value="100" id="counter5">

                        <div class="form-group" style="position:absolute; left:638px; bottom:22px;">
                            <label style="position:relative; right:55px; top:19px;" for="inputEmail" class="col-lg-3"><b>Date:</b></label>
                            <div class="col-lg-9" id="date">
                                <input type="date" name="date" class="form-control">
                                var dt = new Date();
                                document.getElementById("date").innerHTML = dt.toLocaleDateString();

                        <div class="form-group" style="position:relative; left:780px; bottom:54px;">
                            <label style="position:relative; right:60px; top:18px;" for="inputEmail" class="col-lg-3"><b>Time:</b></label>
                            <div class="col-lg-9" id="time">
                                <input type="time" name="time" class="form-control">
                                var dt = new Date();
                                document.getElementById("time").innerHTML = dt.toLocaleTimeString();
<div class="form-group" style="position:absolute; left:33px;">
                <div class="col-lg-12">
                    <button class="button1" type="reset" class="btn btn-default">Cancel</button>
                    <button class="button1" type="submit" class="btn btn-primary" onClick="confSubmit(this.form);">Submit</button>
                        .button1:hover {
                            background-color: #555555;
                            color: aqua;
                            border: 3px solid grey;



I prefer not to pass any date/time parameters.

I set the MySql table field type to TTIMESTAMP and set the feld attriibute to on update CURRENT_TIMESTAMP.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.