Confirmation Number

M

Matt

I was wondering if there is some way to have a
confirmation number auto-generate in a normal form. Sort
of like when Access will create a record number.
Furthermore, if that isn't possible I wanted to use the
Date & Time as the confirmation number. (As the Date &
Time will never come around again). How can I have this
show up on a confirmation page. I attempted to use the
[Date] webbot confirmaiton field, however, it wont show
the time. (See website:
http://131.216.159.32/whitepine/reservations.htm
submit a form (using the name Steve Jones, so I know to
ignore it) and check where it says confirmation number.
Thanks!!!
 
J

j

You need to make that page .asp instead of .htm if you want to use ASP.

Then you could glop the day,mon,yr,h,m,s together to get a number like so:

<%
response.write day(date) & month(date) & year(date) & hour(time) &
minute(time) & second(time)
%>
 
M

MD WebsUnlimited.com

Hi Matt,

You can use JavaScript on client side to create a confirmation number or use
the current date and time. To accomplish this via a date place the following
script in your head section.

<script>
function getToday() {
oDate = new Date();
sDate = '' + (oDate.getMonth() + 1) + '-' + oDate.getDate() + '-' +
oDate.getFullYear();
return sDate
}
</script>

Then if you have a form named myForm with a hidden field myDate

<form name="myForm">
<input type=text value="" name="myDate" >
</form>

you would use the following in the onload event of the body tag to load the
current date o

<body onload="myForm.myDate.value = getToday();">

If you wish to use something else change the function getToday
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top