Richard Duke
|
| Posted: 11/20/2002, 4:41 AM |
|
I have a PHP/Mysql project. i have two text fields on a form , one for DepDate and one for Edate. I need to set the value for Edate to whatever has been entered for DepDate if a user does not enter anything into Edate. Any ideas on how I should do this?
Thanks and regards
|
|
|
 |
RonB
|
| Posted: 11/21/2002, 8:00 AM |
|
CC?/CCS?
in before insert event:
CC:
if($fldEdate == "")
{
$fldEdate=$fldDepDate;
}
CCS:
global $yourgrid;
if($yourgrid->Edate->Value == "")
{
$yourgrid->Edate->setvalue($yourgrid->DepDate->Value);
}
Or you could write some javascript:
In <head>
<script language="JavaScript">
function checkEdate()
{
if(document.all.Edate.value == "")
{
document.all.Edate.value=document.all.DepDate.value;
}
}
</head>
In the insert/update button html on your page insert:
onclick="checkEdate()"
Hope this helps,
Ron
|
|
|
 |
|