You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Steinar Rune Eriksen <sr...@bizpartner.no> on 2005/05/30 11:42:22 UTC

Form widgets - alternative options multually exclusive

Hi

I am wondering if it is possible to indicate that either one of two tabs 
need to be filled in. i.e. that the user selects one tab only during a 
registration:

            <fi:group>
               <fi:styling type="choice"/>
               <fi:label>Velg registrering: </fi:label>
               <fi:state>
                 <ft:widget id="tab-state"/>
               </fi:state>

               <fi:items>
                 <fi:group>



Currently if some fields on the other tab are mandatory the user will 
not be able to submit the form unless these are also filled in.

My case is a registration where the user selects to be either a private 
customer or a company customer, with different fields in the different 
tabs. It's ok if no fields are set as required, but I would like to 
validate that they are filled within the selected tab.


(Using cocoon 2.1.5.1)

Regards

Steinar


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Form widgets - alternative options multually exclusive

Posted by JP <ta...@yahoo.com>.
Still waiting for any better solution....

Found a solution...not sure if this is the best way....Any suggestions will
be appreciated
Put the widgets in a Group and on the submit widget write the javascript as
         <fd:on-action>
            <fd:javascript>
              var parent = event.source.parent;
              if (parent.validate()) {
                print("Validation Success");
              }
              else {
                var form = event.source.form;
                print("Validation Failed Stop Form Processing");
                print("Get Error::"+form.getValidationError());
                form.endProcessing(true);
              }
            </fd:javascript>
          </fd:on-action>
Thanks
JP

JP wrote:
> 
> Hi, 
> I'm having the same problem, did you find any solution. I'll really
> appreciate if you can help me. Thanks in advance.
> 
> JP
> 
> Steinar Rune Eriksen wrote:
>> 
>> Hi
>> 
>> I am wondering if it is possible to indicate that either one of two tabs 
>> need to be filled in. i.e. that the user selects one tab only during a 
>> registration:
>> 
>>             <fi:group>
>>                <fi:styling type="choice"/>
>>                <fi:label>Velg registrering: </fi:label>
>>                <fi:state>
>>                  <ft:widget id="tab-state"/>
>>                </fi:state>
>> 
>>                <fi:items>
>>                  <fi:group>
>> 
>> 
>> 
>> Currently if some fields on the other tab are mandatory the user will 
>> not be able to submit the form unless these are also filled in.
>> 
>> My case is a registration where the user selects to be either a private 
>> customer or a company customer, with different fields in the different 
>> tabs. It's ok if no fields are set as required, but I would like to 
>> validate that they are filled within the selected tab.
>> 
>> 
>> (Using cocoon 2.1.5.1)
>> 
>> Regards
>> 
>> Steinar
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Form-widgets---alternative-options-multually-exclusive-tf36702.html#a6651816
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Form widgets - alternative options multually exclusive

Posted by JP <ta...@yahoo.com>.
Hi, 
I'm having the same problem, did you find any solution. I'll really
appreciate if you can help me. Thanks in advance.

JP

Steinar Rune Eriksen wrote:
> 
> Hi
> 
> I am wondering if it is possible to indicate that either one of two tabs 
> need to be filled in. i.e. that the user selects one tab only during a 
> registration:
> 
>             <fi:group>
>                <fi:styling type="choice"/>
>                <fi:label>Velg registrering: </fi:label>
>                <fi:state>
>                  <ft:widget id="tab-state"/>
>                </fi:state>
> 
>                <fi:items>
>                  <fi:group>
> 
> 
> 
> Currently if some fields on the other tab are mandatory the user will 
> not be able to submit the form unless these are also filled in.
> 
> My case is a registration where the user selects to be either a private 
> customer or a company customer, with different fields in the different 
> tabs. It's ok if no fields are set as required, but I would like to 
> validate that they are filled within the selected tab.
> 
> 
> (Using cocoon 2.1.5.1)
> 
> Regards
> 
> Steinar
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Form-widgets---alternative-options-multually-exclusive-tf36702.html#a6556673
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org