From: Captain Paralytic on 30 Jul 2010 15:03 On Jul 29, 2:23 pm, SAM <stephanemoriaux.NoAd...(a)wanadoo.fr.invalid> wrote: > Le 7/29/10 6:50 AM, jr a écrit : > > > Something is not working on the validation script. The bu is > > required in a search form. Zonenm and zoneid are required together. > > aren't you too tired to always ask the same thing ? > > can't you think by yourself ? Of course not, this is JRough!
From: Captain Paralytic on 30 Jul 2010 15:04 On Jul 29, 6:00 am, David Mark <dmark.cins...(a)gmail.com> wrote: > On Jul 29, 12:50 am, jr <jlro...(a)yahoo.com> wrote: > > > > > > > Something is not working on the validation script. The bu is > > required in a search form. Zonenm and zoneid are required together. > > If someone searches on a bu and also a zoneid, then they must also > > search on the zonenm and vice versa.So it is either all 3 or just the > > bu. The bu validation always works. HOwever if I search on bu and > > zoneid for example, I get a message asking for zonenm, but > > alternatively, if I ask for the zoneid and bu, it should ask for the > > zonenm. I tried it with the 3rd else if as an else instead of else if > > but then I got a syntax error. thanks, > > <script type="text/javascript"> > > function checkscript() { > > var ele = document.forms[0].elements; > > if (!ele.search_bu.value) { > > alert('The Business Unit is a required field!'); > > return false; > > } else if (ele.search_zoneid.value && !ele.search_zonenm.value) { > > alert('Zone ID but no zone number'); > > return false; > > > } else if(ele.search_zonenm.value && !ele.search_zoneid.value) { > > alert('Zone Number but no zone id'); > > return false; > > } > > return true; > > } > > </script> > > Why use else's at all? Each conditional branch returns after all. ;) You are assuming that the poster is an intelligent being. It is however JRough, to whom intelligence is a foreign land.
From: David Mark on 30 Jul 2010 16:31
On Jul 30, 3:04 pm, Captain Paralytic <paul_laut...(a)yahoo.com> wrote: > On Jul 29, 6:00 am, David Mark <dmark.cins...(a)gmail.com> wrote: > > > > > > > On Jul 29, 12:50 am, jr <jlro...(a)yahoo.com> wrote: > > > > Something is not working on the validation script. The bu is > > > required in a search form. Zonenm and zoneid are required together.. > > > If someone searches on a bu and also a zoneid, then they must also > > > search on the zonenm and vice versa.So it is either all 3 or just the > > > bu. The bu validation always works. HOwever if I search on bu and > > > zoneid for example, I get a message asking for zonenm, but > > > alternatively, if I ask for the zoneid and bu, it should ask for the > > > zonenm. I tried it with the 3rd else if as an else instead of else if > > > but then I got a syntax error. thanks, > > > <script type="text/javascript"> > > > function checkscript() { > > > var ele = document.forms[0].elements; > > > if (!ele.search_bu.value) { > > > alert('The Business Unit is a required field!'); > > > return false; > > > } else if (ele.search_zoneid.value && !ele.search_zonenm.value) { > > > alert('Zone ID but no zone number'); > > > return false; > > > > } else if(ele.search_zonenm.value && !ele.search_zoneid.value) { > > > alert('Zone Number but no zone id'); > > > return false; > > > } > > > return true; > > > } > > > </script> > > > Why use else's at all? Each conditional branch returns after all. ;) > > You are assuming that the poster is an intelligent being. It is > however JRough, to whom intelligence is a foreign land. You are assuming I know one "JR" (or "jr") from the next. That's why people should use unique "handles" on Usenet, preferably their real name. |