summaryrefslogtreecommitdiff
path: root/appli_3_alpha_old/script.js
diff options
context:
space:
mode:
Diffstat (limited to 'appli_3_alpha_old/script.js')
-rw-r--r--appli_3_alpha_old/script.js52
1 files changed, 41 insertions, 11 deletions
diff --git a/appli_3_alpha_old/script.js b/appli_3_alpha_old/script.js
index b68f261..7123fba 100644
--- a/appli_3_alpha_old/script.js
+++ b/appli_3_alpha_old/script.js
@@ -1,18 +1,48 @@
+function isNotEmpty (idInput)
+{
+ if (document.getElementById(idInput).value.length > 0) { return (true);} else {return (false);}
+}
+
function addPers(form)
{
- if(form.contactDispo.options.selectedIndex>=0)
+ if(form.contactDispo)
{
- var oValue = form.contactDispo.options[form.contactDispo.options.selectedIndex].value;
-
- var exist = false;
- var i = 0;
- while (i<form.participants.options.length && !exist) { if (form.participants.options[i].value == oValue) exist = true; i=i+1;}
-
- if (!exist)
+ if(form.contactDispo.options.selectedIndex>=0)
{
- var oText = form.contactDispo.options[form.contactDispo.options.selectedIndex].text;
- var o = new Option(oText,oValue);
- form.participants.options[form.participants.options.length]=o;
+ var oValue = form.contactDispo.options[form.contactDispo.options.selectedIndex].value;
+
+ var exist = false;
+ var i = 0;
+ while (i<form.participants.options.length && !exist) { if (form.participants.options[i].value == oValue) exist = true; i=i+1;}
+
+ if (!exist)
+ {
+ var oText = form.contactDispo.options[form.contactDispo.options.selectedIndex].text;
+ var o = new Option(oText,oValue);
+ form.participants.options[form.participants.options.length]=o;
+ }
+ }
+ }
+}
+
+function addAllPers(form)
+{
+ if(form.contactDispo)
+ {
+ for (var j=0;j<form.contactDispo.options.length;j++)
+ {
+ var oValue = form.contactDispo.options[j].value;
+ var exist = false;
+ var i = 0;
+
+ while (i<form.participants.options.length && !exist) { if (form.participants.options[i].value == oValue) exist = true; i=i+1;}
+
+ if (!exist)
+ {
+ var oText = form.contactDispo.options[j].text;
+ var o = new Option(oText,oValue);
+ form.participants.options[form.participants.options.length]=o;
+ }
}
}
}