I have a PHP form that submits information to a MySQL database. I have a script that I want to use so when a changed/cancel radio button is clicked, it will put today's date in two fields for the Date Updated, a Hidden DateUpdated2 field and Text DateUpdated field and 2 fields for the date cancelled/closed Date Closed a Hidden DateClosed2 field and Text DateClosed field. The Hidden fields have a different format from the text fields that is necessary for reporting purposes. Here is the script:
<script language="JavaScript" type="text/JavaScript">
<!-- functions to set the update and cancel dates -->
var d = new Date();
var t_date = d.getDate(); // Returns the day of the month
var t_mon = d.getMonth(); // Returns the month as a digit
var t_year = d.getFullYear(); // Returns 4 digit year
function todaysDateUpdate()
{
document.form1.DateUpdated
.value = (t_mon+1) + "/" + t_date + "/" + t_year;
document.form1.DateUpdated
2.value = t_year + "/" + (t_mon+1) + "/" + t_date;
document.form1.DateClosed.
value = " ";
document.form1.DateClosed2
.value = " ";
document.form1.Approved.va
lue = true;
document.form1.IntergroupU
pdate[2].c
hecked=FAL
SE;
}
function todaysDateCancel()
{
document.form1.DateClosed.
value = (t_mon+1) + "/" + t_date + "/" + t_year;
document.form1.DateClosed2
.value = t_year + "/" + (t_mon+1) + "/" + t_date;
document.form1.DateUpdated
.value = " ";
document.form1.DateUpdated
2.value = " ";
document.form1.Approved.va
lue = false;
document.form1.IntergroupU
pdate[1].c
hecked=FAL
SE;
}
//-->
</script>
Here is the url where the page is located:
http://www.ceahow.org/intergroups/update_search.php?IGNumber=90101&Submit=SubmitI hope someone can help.
Start Free Trial