Contact form
Posted: Sun Mar 22, 2020 6:27 pm
I want to have a form where one of the fields sent back to the server has the current date and time in. I do not want to have the user have to enter the date and time or even select the date and time from a calendar widget, I just want to have the date and time put in the field and sent on either as a displayed field or hidden field. I looked at the prebuilt JAVA routines for date and time but they just place the information as text on the web page but not within a control field. I have set up an Editbox and tried using all three Type attributes for Date, DateTime and DateTime Local but these make the user have to pick a date and also, sometimes the date shown is not the current date but some old date which makes no sense. I have also tried Javascript to insert a date into an Editbox field on the form such as:
<script>
function dateToday() {
var d = new Date();
f = this.getField("Editbox5");
f.value = d;
}</script>
dateToday();
Nothing seems to work. Why doesn't the WYSIWYG have a simple way to insert the date and time?
<script>
function dateToday() {
var d = new Date();
f = this.getField("Editbox5");
f.value = d;
}</script>
dateToday();
Nothing seems to work. Why doesn't the WYSIWYG have a simple way to insert the date and time?