|
From: Benjamin C. <bc...@us...> - 2002-10-30 22:35:00
|
Update of /cvsroot/phpbt/phpbt/templates/default/admin
In directory usw-pr-cvs1:/tmp/cvs-serv2556/templates/default/admin
Modified Files:
component-edit.html project-add.html project-edit.html
version-edit.html
Log Message:
Added client-side error checking
Index: component-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/component-edit.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- component-edit.html 16 Sep 2002 19:39:34 -0000 1.6
+++ component-edit.html 30 Oct 2002 22:34:57 -0000 1.7
@@ -1,7 +1,27 @@
+<script language="JavaScript">
+ var nameString = '{$STRING.givename}';
+ var descString = '{$STRING.givedesc}';
+
+ {literal}
+ function checkForm(frm) {
+ if (frm.component_name.value == '') {
+ alert(nameString);
+ frm.component_name.focus();
+ return false;
+ }
+ if (frm.component_desc.value == '') {
+ alert(descString);
+ frm.component_desc.focus();
+ return false;
+ }
+ return true;
+ }
+ {/literal}
+</script>
<b>{$page_title}</b>
<hr size="1">
{if $error}<div class="error">{$error}</div>{/if}
- <form action="{$smarty.server.PHP_SELF}" method="post">
+ <form action="{$smarty.server.PHP_SELF}" method="post" onSubmit="return checkForm(this)">
<table border="0">
<input type="hidden" name="do" value="component">
<input type="hidden" name="component_id" value="{$component_id}">
Index: project-add.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/project-add.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- project-add.html 16 Sep 2002 19:04:31 -0000 1.5
+++ project-add.html 30 Oct 2002 22:34:57 -0000 1.6
@@ -1,4 +1,42 @@
-<form action="project.php" method="post">
+<script language="JavaScript">
+<!--
+ var nameString = '{$STRING.givename}';
+ var descString = '{$STRING.givedesc}';
+ var versionString = '{$STRING.giveversion}';
+
+ {literal}
+ function checkForm(frm) {
+ if (frm.project_name.value == '') {
+ alert(nameString);
+ frm.project_name.focus();
+ return false;
+ }
+ if (frm.project_desc.value == '') {
+ alert(descString);
+ frm.project_desc.focus();
+ return false;
+ }
+ if (frm.version_name.value == '') {
+ alert(versionString);
+ frm.version_name.focus();
+ return false;
+ }
+ if (frm.component_name.value == '') {
+ alert(nameString);
+ frm.component_name.focus();
+ return false;
+ }
+ if (frm.component_desc.value == '') {
+ alert(descString);
+ frm.component_desc.focus();
+ return false;
+ }
+ return true;
+ }
+ {/literal}
+// -->
+</script>
+<form action="project.php" method="post" onSubmit="return checkForm(this)">
<input type="hidden" name="id" value="0">
<input type="hidden" name="do" value="project">
<table border="0">
Index: project-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/project-edit.html,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- project-edit.html 16 Sep 2002 19:04:31 -0000 1.11
+++ project-edit.html 30 Oct 2002 22:34:57 -0000 1.12
@@ -2,7 +2,23 @@
<!--
var me = '{$smarty.server.PHP_SELF}';
var projectId = '{$project_id}';
+ var nameString = '{$STRING.givename}';
+ var descString = '{$STRING.givedesc}';
+
{literal}
+ function checkForm(frm) {
+ if (frm.project_name.value == '') {
+ alert(nameString);
+ frm.project_name.focus();
+ return false;
+ }
+ if (frm.project_desc.value == '') {
+ alert(descString);
+ frm.project_desc.focus();
+ return false;
+ }
+ return true;
+ }
function popupComponent(id) {
window.open(me + '?op=edit_component&project_id='+projectId+'&use_js=1&id='+id, 'ewin', 'dependent=yes,width=450,height=300,scrollbars=1');
@@ -17,7 +33,7 @@
// -->
</script>
-<form action="{$smarty.server.PHP_SELF}" method="post">
+<form action="{$smarty.server.PHP_SELF}" method="post" onSubmit="return checkForm(this)">
<input type="hidden" name="id" value="{$project_id}">
<input type="hidden" name="do" value="project">
<table border="0" cellpadding="2" cellspacing="2" width="100%">
Index: version-edit.html
===================================================================
RCS file: /cvsroot/phpbt/phpbt/templates/default/admin/version-edit.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- version-edit.html 16 Sep 2002 19:39:34 -0000 1.6
+++ version-edit.html 30 Oct 2002 22:34:57 -0000 1.7
@@ -1,7 +1,21 @@
+<script language="JavaScript">
+ var nameString = '{$STRING.giveversion}';
+
+ {literal}
+ function checkForm(frm) {
+ if (frm.version_name.value == '') {
+ alert(nameString);
+ frm.version_name.focus();
+ return false;
+ }
+ return true;
+ }
+ {/literal}
+</script>
<b>{$page_title}</b>
<hr size="1">
{if $error}<div class="error">{$error}</div>{/if}
- <form action="{$smarty.server.PHP_SELF}" method="post">
+ <form action="{$smarty.server.PHP_SELF}" method="post" onSubmit="return checkForm(this)">
<table border="0">
<input type="hidden" name="do" value="version">
<input type="hidden" name="version_id" value="{$version_id}">
|