Hi,
I have a pretty basic HTML form, it doesn’t go to a database or anything, it just gets emailed directly to the owner of the website with their customer query. However, the owner has now asked that each query be assigned a random reference number of no more than 16 digits which must also be visible to the customer. I presume this will be relatively easy but I’m a complete beginner with Javascript which I assumed would be necessary for generating the number. I’ve sort of figured out how to generate the number but I can’t figure out how to get that number into a read-only field on the form so that it will be both visible to the client and sent with the rest of the data on the form to the owner.
I’ve had a number of attempts but this is what I’m trying at the moment:
[CODE]<html>
<head>
<title>xxx</title>
</head>
<script language=”javascript” type=”text/javascript”>
function randomnumber() {
document.form.randomnumber.value=(Math.round(Math.random()*9999999999999999+1));
}
</script>
<form>
<input name=”randomnumber” readonly>
</form>
</body>
</html>