Update of /cvsroot/phpbt/phpbt/templates/default/admin
In directory usw-pr-cvs1:/tmp/cvs-serv21823/templates/default/admin
Modified Files:
database-edit.html group-edit.html os-edit.html
resolution-edit.html severity-edit.html site-edit.html
status-edit.html
Log Message:
Added client-side validation.
Index: database-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/database-edit.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- database-edit.html 30 Sep 2002 18:02:06 -0000 1.3
+++ database-edit.html 5 Nov 2002 20:58:18 -0000 1.4
@@ -1,6 +1,20 @@
+<script language="JavaScript">
+ var nameString = '{$STRING.givename}';
+
+ {literal}
+ function checkForm(frm) {
+ if (frm.database_name.value == '') {
+ alert(nameString);
+ frm.database_name.focus();
+ return false;
+ }
+ return true;
+ }
+ {/literal}
+</script>
<b>{$page_title} </b>
<hr size="1">
-<form action="{$smarty.server.PHP_SELF}" method="post">
+<form action="{$smarty.server.PHP_SELF}" method="post" onSubmit="return checkForm(this)">
<input type="hidden" name="database_id" value="{$database_id}">
<input type="hidden" name="use_js" value="{$smarty.request.use_js}">
<table border='0'>
Index: group-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/group-edit.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- group-edit.html 16 Sep 2002 19:04:30 -0000 1.4
+++ group-edit.html 5 Nov 2002 20:58:19 -0000 1.5
@@ -1,6 +1,20 @@
+<script language="JavaScript">
+ var nameString = '{$STRING.givename}';
+
+ {literal}
+ function checkForm(frm) {
+ if (frm.group_name.value == '') {
+ alert(nameString);
+ frm.group_name.focus();
+ return false;
+ }
+ return true;
+ }
+ {/literal}
+</script>
<b>{$page_title} </b>
<hr size="1">
-<form action="{$smarty.server.PHP_SELF}" method="post">
+<form action="{$smarty.server.PHP_SELF}" method="post" onSubmit="return checkForm(this)">
<input type="hidden" name="group_id" value="{$group_id}">
<input type="hidden" name="use_js" value="{$smarty.request.use_js}">
<table border='0'>
Index: os-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/os-edit.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- os-edit.html 18 May 2002 03:00:50 -0000 1.4
+++ os-edit.html 5 Nov 2002 20:58:19 -0000 1.5
@@ -1,6 +1,20 @@
+<script language="JavaScript">
+ var nameString = '{$STRING.givename}';
+
+ {literal}
+ function checkForm(frm) {
+ if (frm.os_name.value == '') {
+ alert(nameString);
+ frm.os_name.focus();
+ return false;
+ }
+ return true;
+ }
+ {/literal}
+</script>
<b>{$page_title} </b>
<hr size="1">
-<form action="{$smarty.server.PHP_SELF}" method="post">
+<form action="{$smarty.server.PHP_SELF}" method="post" onSubmit="return checkForm(this)">
<input type="hidden" name="os_id" value="{$os_id}">
<input type="hidden" name="use_js" value="{$smarty.request.use_js}">
<table border='0'>
Index: resolution-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/resolution-edit.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- resolution-edit.html 16 Sep 2002 19:04:32 -0000 1.4
+++ resolution-edit.html 5 Nov 2002 20:58:19 -0000 1.5
@@ -1,6 +1,26 @@
+<script language="JavaScript">
+ var nameString = '{$STRING.givename}';
+ var descString = '{$STRING.givedesc}';
+
+ {literal}
+ function checkForm(frm) {
+ if (frm.resolution_name.value == '') {
+ alert(nameString);
+ frm.resolution_name.focus();
+ return false;
+ }
+ if (frm.resolution_desc.value == '') {
+ alert(descString);
+ frm.resolution_desc.focus();
+ return false;
+ }
+ return true;
+ }
+ {/literal}
+</script>
<b>{$page_title} </b>
<hr size="1">
-<form action="{$smarty.server.PHP_SELF}" method="post">
+<form action="{$smarty.server.PHP_SELF}" method="post" onSubmit="return checkForm(this)">
<input type="hidden" name="resolution_id" value="{$resolution_id}">
<input type="hidden" name="use_js" value="{$smarty.request.use_js}">
<table border='0'>
Index: severity-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/severity-edit.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- severity-edit.html 16 Sep 2002 19:04:33 -0000 1.4
+++ severity-edit.html 5 Nov 2002 20:58:19 -0000 1.5
@@ -1,6 +1,26 @@
+<script language="JavaScript">
+ var nameString = '{$STRING.givename}';
+ var descString = '{$STRING.givedesc}';
+
+ {literal}
+ function checkForm(frm) {
+ if (frm.severity_name.value == '') {
+ alert(nameString);
+ frm.severity_name.focus();
+ return false;
+ }
+ if (frm.severity_desc.value == '') {
+ alert(descString);
+ frm.severity_desc.focus();
+ return false;
+ }
+ return true;
+ }
+ {/literal}
+</script>
<b>{$page_title} </b>
<hr size="1">
-<form action="{$smarty.server.PHP_SELF}" method="post">
+<form action="{$smarty.server.PHP_SELF}" method="post" onSubmit="return checkForm(this)">
<input type="hidden" name="severity_id" value="{$severity_id}">
<input type="hidden" name="use_js" value="{$smarty.request.use_js}">
<table border='0'>
Index: site-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/site-edit.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- site-edit.html 13 Jun 2002 14:26:40 -0000 1.1
+++ site-edit.html 5 Nov 2002 20:58:19 -0000 1.2
@@ -1,6 +1,20 @@
+<script language="JavaScript">
+ var nameString = '{$STRING.givename}';
+
+ {literal}
+ function checkForm(frm) {
+ if (frm.site_name.value == '') {
+ alert(nameString);
+ frm.site_name.focus();
+ return false;
+ }
+ return true;
+ }
+ {/literal}
+</script>
<b>{$page_title} </b>
<hr size="1">
-<form action="{$smarty.server.PHP_SELF}" method="post">
+<form action="{$smarty.server.PHP_SELF}" method="post" onSubmit="return checkForm(this)">
<input type="hidden" name="site_id" value="{$site_id}">
<input type="hidden" name="use_js" value="{$smarty.request.use_js}">
<table border='0'>
Index: status-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/status-edit.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- status-edit.html 16 Sep 2002 19:04:34 -0000 1.4
+++ status-edit.html 5 Nov 2002 20:58:19 -0000 1.5
@@ -1,6 +1,26 @@
+<script language="JavaScript">
+ var nameString = '{$STRING.givename}';
+ var descString = '{$STRING.givedesc}';
+
+ {literal}
+ function checkForm(frm) {
+ if (frm.status_name.value == '') {
+ alert(nameString);
+ frm.status_name.focus();
+ return false;
+ }
+ if (frm.status_desc.value == '') {
+ alert(descString);
+ frm.status_desc.focus();
+ return false;
+ }
+ return true;
+ }
+ {/literal}
+</script>
<b>{$page_title} </b>
<hr size="1">
-<form action="{$smarty.server.PHP_SELF}" method="post">
+<form action="{$smarty.server.PHP_SELF}" method="post" onSubmit="return checkForm(this)">
<input type="hidden" name="status_id" value="{$status_id}">
<input type="hidden" name="use_js" value="{$smarty.request.use_js}">
<table border='0'>
|