To start with look at…

 

http://www.exadel.com/tutorial/jsf/jsftags-guide.html

 

& the section…

 

Enter address:
<h:message style="color: red" for="" />
<h:inputText id="useraddress" value="#{jsfexample.address}"  required="true"/>
<h:commandButton action="" value="Save"/>

 

 

required="true" will make sure the person enters some data in to that field.

Also add in the line…

 

<t:messages id="messageList" styleClass="error" summaryFormat="{0} in {1}" />

 

That will print out the error messages.

 

Hope that gets you started.

 

Jeff

 

 

 

-----Original Message-----
From: Emily Gu [mailto:[EMAIL PROTECTED]
Sent: 13 January 2006 17:12
To: MyFaces Discussion
Subject: Re: How to make Client Side JS validation working on form submission?

 

I want to do very simple validation. Such as,

 

Whether a <h:inputText../> is empty. Or when the radio selection changes, some text input field becomes required. I don't think it is  a good idea to go back to Server Side each time for such simple validation. Can you explain more on what MyFaces great validation framework?

 

Thanks for your help!

Emily

 

On 1/13/06, Jeffrey Porter <[EMAIL PROTECTED]> wrote:

What is the validation you want to do in your _javascript_?

 

MyFaces provides a very good automatic validation of forms framework.

 

Jeff

 

-----Original Message-----
From: Emily Gu [mailto: [EMAIL PROTECTED]]
Sent: 13 January 2006 16:52
To: [email protected]
Subject: How to make Client Side JS validation working on form submission?

 

Hi,

 

  None of my client side form validation is working. I have a page with form and CommandLink as the button. I have tried to do

 

       <h:form id="myForm" validate()">.....

 

  or

       <h:commandLink immediate="false"

                                 action=""

                                 styleClass="formButtonLink"

                                 >

                                 >

                                 value="Create" />

 

   None of JS got invoked. How to make such JS client side validation working?

 

Thanks for your help!!

Emily

 

Reply via email to