We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10793
    • 0 Posts
    Hi All,

    I have a form to update user profile, using also extended (or custom) fields.
    No problem at all with "plain" extended fields, I mean fields not included in a container.

    If I create a container (e.g. named "Org" for organizational data) and a field in it (e.g. named "Dept" for department), then I can change the field value but I can’t upload it on a HTML form.

    The resource HTML code is the following (it’s a test page):

    <h1>Profile</h1>
    
    <p><a href="[[~6]]">My Home Page</a></p>
    
    [[!UpdateProfile]]
    
    <div class="update-profile">
        <div class="updprof-error">[[+error.message]]</div>
        [[+login.update_success:if=`[[+login.update_success]]`:is=`1`:then=`[[%login.profile_updated? &namespace=`login` &topic=`updateprofile`]]`]]
     
        <form class="form" action="[[~[[*id]]]]" method="post">
            <input type="hidden" name="nospam:blank" value="" />
     
            <label for="reparto">Department
                <span class="error">[[+error.reparto]]</span>
            </label>
            <input type="text" name="reparto" id="reparto" value="[[+reparto]]" />
    
    
            <label for="dept">Org.Dept
                <span class="error">[[+error.org.dept]]</span>
            </label>
            <input type="text" name="orgdept" id="dept" value="[[+org.dept]]" />
     
            <br class="clean" />
     
            <div class="form-buttons">
                <input type="submit" name="login-updprof-btn" value="[[!%login.update_profile]]" />
            </div>
        </form>
    </div>


    "reparto" is the extended field that works (showed in the form and changeable).
    "orgdept" is the extended field that doesn’t work (not showed but changed with value="[[+org.dept]]").
    In the "name" attribute I used the following names but they don’t work:

    name="org.dept" (actually creates a field named org_dept)
    name="org_dept"
    name="[org]dept"
    name="org->dept"

    Before trying all the ASCII chars, I decided to call for your help...

    How should I set the name attribute to get the field value ?

    Thanx



      • 37597
      • 3 Posts
      Hi Gianna,

      If you haven't figured it out yet, here is the solution:

      <input type="hidden" name="payments[ [[+placeholder]] ]" id="payments" value="900" />   


      Make sure on the name attr that you have a space before and after the placeholder. I am assuming that dept will be a placeholder?

      <input type="text" name="org[ [[+dept]] ]" id="dept" value="[[+org.dept]]" />

      [ed. note: kevinraz last edited this post 14 years, 9 months ago.]