Thanks.
It works now.

--Doug
-----Original Message-----
From: Slawek [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 22, 2005 2:11 PM
To: MyFaces Discussion
Subject: Re: Calling action within javascript

no

try this:

function checkPassword(){
        //validation logic
        If (isOK)
        {
                return true;
        }
        Else
        {
                Alert("not match");
                return false;
        }
}

as Steve says:
first JS function is executed
than if that fucntion returns true than form is submited, but if it 
returns false then nothing happends

Sławek Sobóka

> In my javascript function, I have the following:
>
> Function checkPassword(form)
> {
>       If ( pass )
>       {
>               Form.submit();
>       }
>       Else
>       {
>               Alert("not match");
>       }
> }
>
> But it doesn't seem to work.
> Thanks
>
> --Doug
> -----Original Message-----
> From: steve rock [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 22, 2005 11:36 AM
> To: MyFaces Discussion
> Subject: Re: Calling action within javascript
>
> I think  onclick=" return checkPassword(this.form)" then return true
> from your javascript function to submit, else false to cancle submit.
>
>
> On Tue, 22 Feb 2005 11:29:21 -0600, Doug Ly <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>> Hi,
>>
>> I have a javascript to confirm the passwords are matched which will be
>> executed on onclick event of a commandButton tag.
>>
>> <h:commandButton id="passwordSubmit" value="#{user.password}"
>> onclick="checkPassword(this.form)" action="#{user.verify}"/>
>>
>>
>>
>> The problem is after onclick event, how can I call the event action in
> my
>> javascript?
>>
>> Thanks
>>
>> --Doug
>>
>>


Reply via email to