Copied to clipboard

Flag this post as spam?

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


  • Kanika 3 posts 20 karma points
    Mar 03, 2009 @ 05:15
    Kanika
    0

    How to accept inputs from users ?

    How to accept inputs from users ?
    For example , I have a form and the inputs have to be filled by the user.? how do we do this in Umbraco ?
    Can some one give me some pointers where i can get the information and the steps to do it..???

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Mar 03, 2009 @ 08:25
    Dirk De Grave
    0

    Hi,

    Depends what you need to do with the user input. What type of info is it? Do you want to save this as a node in umbraco? If so, use the Document.MakeNew() function. Full details on the function can be found at http://umbraco.org/apiDocs/ (Don't forget the trailing slash, or you'll get a 404)

    Here's a code snippet to help you on the way:

    [code]DocumentType type = DocumentType.GetByAlias("DocumentTypeAlias");
    User user = User.GetUser(0);
    int parentNodeId = -1;

    Document newDocument = Document.MakeNew("Text", type, user, parentNodeId);

    if (newDocument != null && newDocument.Id > 0) {
    newDocument.getProperty("PropertyAlias1").Value = "Property1Value"; newDocument.Publish(user);
    umbraco.library.UpdateDocumentCache(newDocument.Id);
    }[/code]

    Hope this helps.

    Regards,
    /Dirk

  • Daniel Lindstrom 454 posts 271 karma points
    Mar 03, 2009 @ 11:14
    Daniel Lindstrom
    0

    You can also have a look at Doc2Form and see if that works for your needs.

  • 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