Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fredrik Esseen 594 posts 830 karma points
    Mar 11, 2011 @ 09:13
    Fredrik Esseen
    0

    Save the form with the current member

    hi!

    I have a form inside a member area and want to save which member entered the form. Is that possible?

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Mar 11, 2011 @ 09:35
    Tim Geyssens
    0

    Hi,

    Well that should already happen, contour will save the memberid by default

  • Fredrik Esseen 594 posts 830 karma points
    Mar 11, 2011 @ 10:11
    Fredrik Esseen
    0

    Hmm...strange. In the entries list I only see IP and PageID?

  • Fredrik Esseen 594 posts 830 karma points
    Mar 11, 2011 @ 10:13
    Fredrik Esseen
    0

    What if i dont want the member to be able to register multiple entries? is that possible?

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Mar 11, 2011 @ 10:57
    Tim Geyssens
    1

    Sure, here is an example:

     <%
          if(umbraco.cms.businesslogic.member.Member.GetCurrentMember() == null){
         %>
        
           <p>Please login before you cast your vote.</p>
           
        <%}else{
           Umbraco.Forms.Data.Storage.RecordStorage s = new Umbraco.Forms.Data.Storage.RecordStorage();
           var all = s.GetAllRecords(new Guid("12c58e28-ca9e-4e05-9849-8ae8ed555109"));

           var voted = all.Find(r => r.MemberKey.ToString() == umbraco.cms.businesslogic.member.Member.GetCurrentMember().Id.ToString());
             
             if (voted == null)
             {
          %>
          
            <umbraco:Macro FormGuid="12c58e28-ca9e-4e05-9849-8ae8ed555109" Alias="umbracoContour.RenderForm" runat="server"></umbraco:Macro>


           <% }else{ %>
             
             <p>Looks like you already voted.</p>
             
             <% }} %>
  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Mar 11, 2011 @ 10:57
    Tim Geyssens
    0

    Might not be in the entries viewer but should be in the exports

  • Fredrik Esseen 594 posts 830 karma points
    Mar 11, 2011 @ 12:08
    Fredrik Esseen
    0

    Perfect!

    Worked nice!

    Another question: Could I display the form but disabling the submit button?

  • Harald Ulriksen 207 posts 248 karma points
    Mar 16, 2011 @ 09:29
    Harald Ulriksen
    0

    You can either inherit from the renderform, http://farmcode.org/post/2010/03/26/Regionalizing-validation-messages-and-regex-in-Umbraco-Contour.aspx, or wrap it in your own control, http://harald.ulriksen.net/2010/6/1/wrapping-an-umbraco-contour-form-in-your-own-user-control.aspx#comment-2. You can then disable the button in the OnPreRender event.  Locate the button by traversing the control tree and check for type (and button text)

    Hope this helps,
    Harald

  • Cornelia 31 posts 53 karma points
    Apr 06, 2011 @ 13:15
    Cornelia
    0

    Hi all

    I have pretty the same question, but without members. For this I want to search in specific fields (ex: name, course number, etc.) in the contour entries. Is this possible?

    Thanks for your advice.
    Cornelia

     

  • Cornelia 31 posts 53 karma points
    Apr 07, 2011 @ 12:07
    Cornelia
    0

    Hi all

    I tried to do something like this to show the entries first (only to see if it works) and then perfom a specific search:

    <%
                Umbraco.Forms.Data.Storage.RecordStorage s = new Umbraco.Forms.Data.Storage.RecordStorage();
                var all = s.GetAllRecords(new Guid("fb815000-6865-49fe-9db2-6c10110e359a "));        

                GridView gvEntries = new GridView();
                gvEntries.DataSource = s.GetAllRecords(new Guid("fb815000-6865-49fe-9db2-6c10110e359a "));
                gvEntries.DataBind();

                foreach (GridViewRow row in gvEntries.Rows)
                {
                    Response.Write(row.Cells[0].Text + "; " + row.Cells[1].Text + "; ");
                }
    %>

    Should this approach work? At the moment it doesn't.

    Thanks a lot in advance for your input.

    Cornelia

     

     

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies