From: jr on
On Jul 29, 10:30 am, Denis McMahon <denis.m.f.mcma...(a)googlemail.com>
wrote:
> On 29/07/10 05:50, jr wrote:
>
> > Something is not working on the validation script. ...
> > but then I got a syntax error.  thanks,
>
> What was the error message, and what line in the script did it identify?
>
> Rgds
>
> Denis McMahon

I believe I this one does work. I was testing on the wrong page or
something else. It is not elegant but it works.
From: jr on
On Jul 29, 6:23 am, 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 ?
>
> if ( bu.value ) {
>    if ( zoneid.value && !zonenum.value ) { blah 1 }
>    else
>    if ( !zoneid.value && zonenum.value ) { blah 2 }
>    }
> else { blah 0 }
>
> the "blah"s must return false
>
> --
> sm
I'm sorry I figured it out. Yours is better but the other one works.
I need to read a Javascript book. I have done hardly any javascript
and the format is slightly different than php.
From: SAM on
Le 7/29/10 9:21 PM, jr a �crit :
> On Jul 29, 6:23 am, 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.
>>
>> can't you think by yourself ?
>>
>> if ( bu.value ) {
>> if ( zoneid.value && !zonenum.value ) { blah 1 }
>> else
>> if ( !zoneid.value && zonenum.value ) { blah 2 }
>> }
>> else { blah 0 }
>>
>> the "blah"s must return false
>>
> I'm sorry I figured it out. Yours is better but the other one works.
> I need to read a Javascript book. I have done hardly any javascript
> and the format is slightly different than php.

not so much ... not so much ... if / else are the same everywhere ;-)

--
sm
From: David Mark on
On Jul 29, 5:21 pm, SAM <stephanemoriaux.NoAd...(a)wanadoo.fr.invalid>
wrote:
> Le 7/29/10 9:21 PM, jr a écrit :
>
>
>
>
>
> > On Jul 29, 6:23 am, 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..
>
> >> can't you think by yourself ?
>
> >> if ( bu.value ) {
> >>    if ( zoneid.value && !zonenum.value ) { blah 1 }
> >>    else
> >>    if ( !zoneid.value && zonenum.value ) { blah 2 }
> >>    }
> >> else { blah 0 }
>
> >> the "blah"s must return false
>
> > I'm sorry I figured it out.  Yours is better but the other one works.
> > I need to read a Javascript book.  I have done hardly any javascript
> > and the format is slightly different than php.
>
> not so much ... not so much ... if / else  are the same everywhere ;-)
>

Pretty much and you don't need an else if the previous conditional
clause exits the function. JSLint is good for spotting these issues.
From: SAM on
Le 7/30/10 12:39 AM, David Mark a �crit :
> On Jul 29, 5:21 pm, SAM <stephanemoriaux.NoAd...(a)wanadoo.fr.invalid>
> wrote:
>>>> if ( bu.value ) {
>>>> if ( zoneid.value && !zonenum.value ) { blah 1 }
>>>> else
>>>> if ( !zoneid.value && zonenum.value ) { blah 2 }
>>>> }
>>>> else { blah 0 }
>>>> the "blah"s must return false
>>> I'm sorry I figured it out. Yours is better but the other one works.
>>> I need to read a Javascript book. I have done hardly any javascript
>>> and the format is slightly different than php.
>> not so much ... not so much ... if / else are the same everywhere ;-)
>
> Pretty much and you don't need an else if the previous conditional
> clause exits the function.

Absolutely !
(posted too quickly :-( )

--
sm