Copied to clipboard

Flag this post as spam?

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


  • tom mortimer 7 posts 28 karma points
    May 22, 2014 @ 12:09
    tom mortimer
    0

    Go to page anchor when form submitted?

    Hi all, maybe this is a simple question, but I can't figure it out or find the answer:

    When the user submits a Contour form, I'd like to direct them to a specific anchor - not just direct them to a page. I believe this is done through the Xpath option under "Send to page", but can't work out the syntax at all.

    To be specific, I would like to send them to an anchor with the ID #form on the same page as the form.

    Would anyone be able to help out please?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    May 22, 2014 @ 13:05
    Jan Skovgaard
    0

    Hi Tom and welcome to our :)

    Do you have some code you're currently working on? Also what version of Umbraco and Contour are you using?

    /Jan

  • tom mortimer 7 posts 28 karma points
    May 22, 2014 @ 13:21
    tom mortimer
    0

    Hi, thanks for the welcome. It's Umbraco 7.1.1 and Contour 3.

    I don't have code as my question relates to the highlighted red box in the UI:

    What I'm hoping to find out is, what do I need to enter in that box to direct the user to an anchor on the current page?

    Many thanks.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    May 22, 2014 @ 13:25
    Jan Skovgaard
    0

    Hi Tom

    In regards to the Contour version the exact version is necessary since a lot of things differ if you're using 3.0.6 or 3.0.22 for instance - However in your case it does not matter too much in order for me to try and provide an answer for your question though :)

    Weird that there is no description - Usually it says something about "Enter XPATH" so you can enter an XPATH expression to find the page you want the user to see after the form has been submitted.

    I don't think it's possible to add a a fragment/id of a page. But you can simply use the "pick node" option to select at page/node for the user to see once the form has been submitted.

    Hope this helps.

    /Jan

  • tom mortimer 7 posts 28 karma points
    May 22, 2014 @ 13:31
    tom mortimer
    0

    Edit: I realised I hadn't said, many thanks for your time on this :)

    Yeah it says "Enter XPath" before I click on it - but my problem was, I have no idea how to write the necessary expression.

    However if, as you say, it's not possible to specify an ID through XPath I'll simply create a "Thank you" page and pick the relevant node.

    I'm surprised there isn't an option to specify a plain URL to send the user to, for the following reasons:

    • What if the user doesn't fill in all the fields and the form is "below the fold", so when they press submit they're just confronted with the page they were on, and have to scroll down to see the highlighted input errors? 
    • Same with a "thank you" message - when the user presses submit, the page refreshes, but they have to scroll down to see the "thank you" message as the form isn't "above the fold"?
  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    May 22, 2014 @ 14:06
    Jan Skovgaard
    0

    Hi Tom

    Think we're misunderstanding each other on the part about what the XPATH field can be used for. You can write an XPATH expression to generically find a certain page type for the user to land on. What I though you we're asking is if it's possible to choose a fragment on the landing page as well...if you have the same landing page for several forms, where there are a couple of headers with each their "Thank you" text, which then had a HTML id...

    like

    <h1 id="faq">FAQ</h1>
    <h1 id="thanks">Thanks</h1>
    

    Then it's not possible to specify http://domain.com/page#thanks but you can specify http://domain.com/page. Sorry about the confusion!

    If you don't specify a landing page then the user will see a then contents from the "Message on submit" and the form will dissapear untill the page has been refreshed.

    Hope this helps and that I have not misunderstood anything :)

    /Jan

  • tom mortimer 7 posts 28 karma points
    May 22, 2014 @ 14:40
    tom mortimer
    0

    No, you're absolutely right - your answer was spot on to my question. I mistakenly thought the XPath field could be used to specify a fragment but you informed me correctly :)

    I then went on to wonder why there was no functionality which allowed me to select an ID, and presented a couple of cases where it would be beneficial. I still wonder this!

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    May 22, 2014 @ 16:23
    Jan Skovgaard
    0

    Hi Tom

    Ok then :)

    But isn't there a "node picker" somewhere where you can click and then select a node from the content tree? Usually there is...I have not played that much around with Contour on v7 yet so have not setup a workflow.

    However I guess it should be possible to click the "or pick a node" text? If not then I think it might be a bug if it's not appearing some place else.

    /Jan

  • tom mortimer 7 posts 28 karma points
    May 22, 2014 @ 16:31
    tom mortimer
    0

    Re the node picker: On the menu shown in my screenshot, you can select a content page using "Pick node" under "Send to page", but it doesn't go any deeper - you can't select a specific content section (eg a certain text box or form) on that page.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    May 22, 2014 @ 16:33
    Jan Skovgaard
    0

    Hi Tom

    Ok, could you show a screendump? Sounds like a bug to me...but need to be sure - what exact version of Contour are you using?

    /Jan

  • tom mortimer 7 posts 28 karma points
    May 22, 2014 @ 16:39
    tom mortimer
    0

    Contour version is 3.0.19

    Screendump below. So when I click "Choose", I'm presented with the right hand side panel, which is a list of my Content pages. Once I click "Home Page", it inserts "Home Page" into the "Send to page" input field.

    This means I can't go deeper than "Home Page" to select a content block - eg a specific text area or form.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    May 22, 2014 @ 18:20
    Jan Skovgaard
    0

    Hi Tom

    Hmmm, that does seem like a bug to me. Do you mind reporting it on the issue tracker if someone has not done it already?

    /Jan

  • tom mortimer 7 posts 28 karma points
    May 22, 2014 @ 19:12
    tom mortimer
    1

    Thanks for your time today Jan, have submitted:

    http://issues.umbraco.org/issue/CON-548

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    May 22, 2014 @ 19:21
    Jan Skovgaard
    0

    Hi Tom

    You're welcome - Hope it works out.

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft