Re: Setting input field to required!?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Setting input field to required!?

Dion Sole
On Aug 6, 4:42 pm, "John Bampton" <[hidden email]> wrote:

> I have the following sample instance (there are other elements in the
>
> instance) and repeating region and I am trying to make the name input a
> required field with the bind tag.  How do I do this?  The bind tag below is
> not working!!?
>
> <xforms:instance id="data-instance">
>
>                 <data>
>
>                     <item>
>
>                         <al>
>
>                             <name></name>
>
>                         </al>
>
>                     </item>
>
>                 </data>
>
>  </xforms:instance>
>
> <xforms:bind nodeset="item/al/name"  id="must-be-present-alname"
>
> required="true()" />
>
>  <xforms:repeat nodeset="item/al" id="al-repeat">
>
>                    <xhtml:tr class="alinput">
>
>                         <xhtml:td>
>
>                             <xforms:input id="alname" ref="name"
>
> incremental="true" class="input"  />
>
>                               <xforms:alert>Name is required</xforms:alert>
>
>                         </xhtml:td>
>
>                         <xhtml:td>
>
>                             <xforms:trigger appearance="minimal">
>
>                                 <xforms:delete ev:event="DOMActivate"
>
> context="instance('data-instance')" nodeset="item/al"
>
> at="index('al-repeat')"/>
>
>                                 <xforms:label>Delete</xforms:label>
>
>                             </xforms:trigger>
>
>                         </xhtml:td>
>
>                     </xhtml:tr>
>
>                   </xforms:repeat>
>
> Regards,
>
> John
What do you mean by "not working"?
Setting something to be required won't prevent it from being deleted,
if that's what you're after.
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms