CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Change textbox value by checkbox event

Print topic Send  topic

Author Message
DJJWP


Posts: 77
Posted: 01/16/2006, 3:07 PM

I would like to be able to have the current date populate the text value of a textbox when the checkbox value is equal to 0(unchecked). If it is set to 1,(Checked) I would like it to clear. I have been playing with JavaScript to try and do this but I’m running into the issue of not being able to see where the failure is at, the call or the function. Any good canned solutions out there?


_________________
Network Operations Rule
View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 01/16/2006, 9:52 PM

DJJWP
Have you considered using the event Before Show to set the textbox value to either current date or leave it clear based on the value of the checkbox.
View profile  Send private message
E43509

Posts: 283
Posted: 01/17/2006, 8:02 AM

You have to use Javascript on the client side. Below is a simple page that you can extract code from that may help you. It's not too elegant but should work for ya.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>

<body>
<form action="www.google.com" name="MyForm" >
My Checkbox<input type="checkbox" name="MyCb" value="1" onClick="mytoday();"><br>
My Textbox <input type="text" name="MyTb"><br>
<input type="submit" name="MySubmit" Value="Submit">
</form>

</body>

<script>
function mytoday() {
var currentTime = new Date();
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
//document.write(month + "/" + day + "/" + year)
document.MyForm.MyTb.value = month + "/" + day + "/" + year;
}
</script>
</html>
View profile  Send private message
DJJWP


Posts: 77
Posted: 01/17/2006, 8:20 AM

I'll give it a try and let you know. Thanks.
_________________
Network Operations Rule
View profile  Send private message

Add new topic Subscribe to topic   


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

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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