Moderator |
|
Je kan beter een onClick-event maken voor die button lijkt me ?
EDIT:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>html template</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
//-->
</style>
<script language="JavaScript" type="text/javascript">
<!--
function next(frm, elt, dir) {
var a = parseInt(document.forms[frm].elements[elt].value);
document.forms[frm].elements[elt].value = (isNaN(a)) ? 0 : a+dir;
}
//-->
</script>
</head>
<body>
<form name="frm" action="..." method="post">
<input type="text" name="teller" size="3" maxlength="3" value="0" />
<button type="button" onclick="next('frm','teller', 1);">+</button>
<button type="button" onclick="next('frm','teller', -1);">-</button>
</form>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>html template</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css"> <!-- //--> </style> <script language="JavaScript" type="text/javascript"> <!-- var a = parseInt(document.forms[frm].elements[elt].value); document .forms [frm ].elements [elt ].value = (isNaN (a )) ? 0 : a +dir;} //--> </script> </head> <body> <form name="frm" action="..." method="post"> <input type="text" name="teller" size="3" maxlength="3" value="0" /> <button type="button" onclick="next('frm','teller', 1);">+</button> <button type="button" onclick="next('frm','teller', -1);">-</button> </form> </body> </html>
|