Skip to content

Instantly share code, notes, and snippets.

@kodi
Created September 4, 2009 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kodi/180983 to your computer and use it in GitHub Desktop.
Save kodi/180983 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>fields test</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js"></script>
<script type="text/javascript">
Event.observe(window, 'load', function() {
Event.observe(window,'click',function(){
if($('date2').value==''){
$('date2').value=$('date1').value;
}
});
});
</script>
</head>
<body>
<input type="text" id="date1" name="date1" />
<input type="text" id="date2" name="date2" />
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment