Copied to clipboard

Flag this post as spam?

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


  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    May 22, 2013 @ 13:07
    Ismail Mayat
    0

    Post form to url workflow

    I have 2 workflows setup on my form after form is submitted. The email one works fine. I have created a post form to url. The url is a page in same site and i have put the it in the url field eg

    /thought-reader/resources/download-thank-you/

    i am also mapping over a field. After the form is submitted i would have thought that the form page would be posted to this url? At the moment i just get thank you message set in the form definition. Am I missing something? Can this actually be done?

    Regards

    Ismail

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    May 22, 2013 @ 13:21
    Tim Geyssens
    0

    Workflow execution happens in the background, if you do want a redirect you'll need to customize the workflow type, sourcecode for all default types is available

    http://our.umbraco.org/FileDownload?id=5060

  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    May 22, 2013 @ 13:25
    Ismail Mayat
    0

    Tim,

    OK I have another idea. Basically what I am trying todo is after form is submitted show a download link. So I have hidden field on form which has id of the download.  I have created razor view for the form.  In the code after submit we have

    @if (Model.SubmitHandled)

    {

        <p class="contourMessageOnSubmit">@Model.MessageOnSubmit</p>

       //can i get the newly submitted value somehow here? if i can get current page ? as the download link and form are on same page?

    @Request["download"]

    }

    If I can get the id after form submitted then i can get and display the download link. How do i get the field value from the newly submitted form?

    Regards

     

    Ismail

     

  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    May 22, 2013 @ 13:40
    Ismail Mayat
    101

    Ok got it working im just using uquery probably better way of doing it

    @if (Model.SubmitHandled)

    {

        <p class="contourMessageOnSubmit">@Model.MessageOnSubmit</p>

        var downloadId = uQuery.GetCurrentNode().GetProperty<string>("download");

        var media = new Media(int.Parse(downloadId));

        <a href="@media.getProperty("umbracoFile").Value">Download</a>

    }

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    May 22, 2013 @ 13:52
    Tim Geyssens
    0

    There should be a record id available and then take a look at the dynamic objects available that will wrap a record and allow you to easily access the data (Umbraco.Forms.Mvc.DynamicObjects namespace)

    Once you have a dynamic record you should be able to do myDynamicRecord.fieldcaption (without spaces)

     

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    May 22, 2013 @ 13:53
    Tim Geyssens
    0

    Ah you want to fetch it from the current page :) yeah that is an option then

  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    May 22, 2013 @ 13:59
    Ismail Mayat
    0

    Tim,

    Works a treat woot! Have to say very very impressed with latest contour think i last used it v1 ish

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    May 22, 2013 @ 14:01
    Tim Geyssens
    0

    Glad to hear that, if you have ideas for further improvements I'm all ears :)

  • 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