Announcement Announcement Module
Collapse
No announcement yet.
how to stop Form Validation on only one transition Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to stop Form Validation on only one transition

    How to stop Form Validation on only one transition. With the following code I have form validation turn on and everything is working great but if the user clicks "cancel" I dont want to run the form validation. anyway around this?
    Code:
    <view-state id="helloworld" view="input.jsp" model="customer" popup="true">
        		<transition on="submit" to="preview" />
        		<transition on="cancel" to="thanks"/>
    </view-state>
    Last edited by JohnTheDroider; Jul 25th, 2012, 10:02 AM.

  • #2
    Please use [ code][/code ] tags when posting code and please take the time to read the reference guide, the section called 'Suppressing validation' should be a give away.

    Comment


    • #3
      thanks Marten Deinum,

      i was looking for it and could not find it but you just pointed me to it.. thanks again

      Comment


      • #4
        I ran into a issue this does not cancel back to the pre-view
        Code:
        <view-state id="address" view="input2.jsp" model="customer">
                    
        			<binder>
        				<binding property="address" required="true"/>
        				<binding property="city" />
        				<binding property="state" />
        				<binding property="zipCode" />
        			</binder>
            		<transition on="submit" to="preview" />
            		<transition on="cancel" to="name" validate="false" />
        	</view-state>

        Comment


        • #5
          use on your button tag immediate=true which skips amongst other things the validation...(if you are using jsf)


          Code:
          <h:commandButton immediate="true" ...../>

          Comment

          Working...
          X