CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 set default date to variable

Print topic Send  topic

Author Message
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

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.