• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Question on <required>XML directive</required>

Scheduled Pinned Locked Moved webGUI
6 Posts 2 Posters 4.3k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    rcarr
    last edited by May 5, 2007, 1:19 AM

    In tinydns_domains.xml (and elsewhere), you can indicate that a certain field MUST be filled out by the user by including the <required>tag, like:

    <field><fieldname>hostname</fieldname>
                            <fielddescr>Hostname or FQDN (e.g.: www.exampledomain.com)</fielddescr>
                            <description>The DNS server will supply Records for the Fully Qualified Domain Name that is enteredription>
                            <required><type>input</type>
                            <size>35</size></required></description></field>

    What if you have two fields and one – either one -- must be filled in.  Is there a way to indicate that?</required>

    1 Reply Last reply Reply Quote 0
    • S Offline
      sullrich
      last edited by May 5, 2007, 1:24 AM

      Not sure I follow.  Simply define required in each area.

      1 Reply Last reply Reply Quote 0
      • R Offline
        rcarr
        last edited by May 5, 2007, 2:32 AM

        Take a tinydns record, for instance:

        &domain:field1:field2

        It isn't mandatory that you supply field1.  It isn't mandatory that you supply field2.  But Tinydns requires you to supply one or both of the fields.

        With the <required>XML tag, I can instruct the GUI to make sure the user fills in field1 or I can instruct the GUI to make sure the user fills in field2.  But how do I get the GUI to make sure the user fills in one of those two fields, without specifying which one?</required>

        1 Reply Last reply Reply Quote 0
        • S Offline
          sullrich
          last edited by May 5, 2007, 2:36 AM

          In those cases you need custom validation.  Take a peek at the openvpn package that does this.

          /usr/local/pkg/openvpn*

          1 Reply Last reply Reply Quote 0
          • R Offline
            rcarr
            last edited by May 5, 2007, 7:16 AM

            Ah!  I will check it out.  Thanks!

            1 Reply Last reply Reply Quote 0
            • R Offline
              rcarr
              last edited by May 5, 2007, 7:29 AM

              Something like what's going on in…

              openvpn.xml:

              <custom_php_command_before_form>...</custom_php_command_before_form>

              1 Reply Last reply Reply Quote 0
              6 out of 6
              • First post
                6/6
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                This community forum collects and processes your personal information.
                consent.not_received