Aleks
asked on
Script to concatenate date and time into a hidden field
I am trying to use a script that concatenates a date field and a time field.
page1: Has the form that posts to page2.
page1 has a start date and start time as well as an end date and end time. It should put date and time together into a hidden field and then post the data. In this demo I post it to page 2 but it will ultimately be inserted into a database.
Attached is the code for both pages. Any help is appreciated. As of now the values come up blank.
example.txt
page1: Has the form that posts to page2.
page1 has a start date and start time as well as an end date and end time. It should put date and time together into a hidden field and then post the data. In this demo I post it to page 2 but it will ultimately be inserted into a database.
Attached is the code for both pages. Any help is appreciated. As of now the values come up blank.
example.txt
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I see ... in the previous page I used a drop down for the 'starttime', on this page its a simple text field.
ASKER
I did this and it works now :)
<script language="javascript" type="text/javascript">
<!--
function putDateInHiddenField() {
var text = document.form1.startdate;
var hidden = document.form1.startdateco mp;
var d = document.form1.startime;
hidden.value = "";
hidden.value += text.value + " " + d.value;
}
-->
</script>
Thanks !
<script language="javascript" type="text/javascript">
<!--
function putDateInHiddenField() {
var text = document.form1.startdate;
var hidden = document.form1.startdateco
var d = document.form1.startime;
hidden.value = "";
hidden.value += text.value + " " + d.value;
}
-->
</script>
Thanks !
ASKER