comwwwdot
01-31-2010, 09:26 AM
Hi guys, could you help me on this script that I would like to implement.
<!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">
<head>
<title>Some Title
</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<form>
<fieldset>
<p><label for="txtCuryear">Academic Year</label><input type="text" name="txtCuryear" id="txtCuryear" /><input type="text" name="txtNxtyear" id="txtNxtyear" /></p>
</fieldset>
</form>
</body>
</html>
there I think I was able to solve it myself :D lol
<p><label for="txtCuryear">Academic Year</label><input type="text" size="4" maxlength="4" name="txtCuryear" id="txtCuryear" /> - <input type="text" size="4" maxlength="4" name="txtNxtyear" id="txtNxtyear" /></p>
<script type="text/javascript">
var sID = document.getElementById('txtCuryear');
sID.onkeyup = function(event) {
document.getElementById('txtNxtyear').value = parseInt(document.getElementById('txtCuryear').value)+1;
}
</script>
I need to display the next year, of the year that is inputted by the user on the current year textbox.
Your help will be greatly appreciated :)
<!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">
<head>
<title>Some Title
</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<form>
<fieldset>
<p><label for="txtCuryear">Academic Year</label><input type="text" name="txtCuryear" id="txtCuryear" /><input type="text" name="txtNxtyear" id="txtNxtyear" /></p>
</fieldset>
</form>
</body>
</html>
there I think I was able to solve it myself :D lol
<p><label for="txtCuryear">Academic Year</label><input type="text" size="4" maxlength="4" name="txtCuryear" id="txtCuryear" /> - <input type="text" size="4" maxlength="4" name="txtNxtyear" id="txtNxtyear" /></p>
<script type="text/javascript">
var sID = document.getElementById('txtCuryear');
sID.onkeyup = function(event) {
document.getElementById('txtNxtyear').value = parseInt(document.getElementById('txtCuryear').value)+1;
}
</script>
I need to display the next year, of the year that is inputted by the user on the current year textbox.
Your help will be greatly appreciated :)