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 |
 |
 |
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.
|
 |
 |
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>
|
 |
 |
DJJWP
Posts: 77
|
| Posted: 01/17/2006, 8:20 AM |
|
I'll give it a try and let you know. Thanks.
_________________
Network Operations Rule |
 |
 |